<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>htaccess | CHOICE</title>
	<atom:link href="https://choice-site.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>https://choice-site.com</link>
	<description>CentOS上での各種設定やTips、PHPやDB関係のことなど</description>
	<lastBuildDate>Wed, 16 Apr 2014 02:20:46 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.2</generator>
	<item>
		<title>接続元IPでアクセスを制限する</title>
		<link>https://choice-site.com/2012/09/28/%e6%8e%a5%e7%b6%9a%e5%85%83ip%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/</link>
		
		<dc:creator><![CDATA[nakade]]></dc:creator>
		<pubDate>Fri, 28 Sep 2012 10:39:09 +0000</pubDate>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[iptables]]></category>
		<guid isPermaLink="false">http://choice-site.com/?p=297</guid>

					<description><![CDATA[<p>サーバのログを見ていると、あまり関わりのない国のIPから怪しげなアクセスが結構あったので、国別、あるいは、個別にIPを制限することにしました。 制限したいIPは変わることもあるし、国別に割り当てられているIPも変わるので&#8230; <a class="more-link" href="https://choice-site.com/2012/09/28/%e6%8e%a5%e7%b6%9a%e5%85%83ip%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/">続きを読む <span class="screen-reader-text">接続元IPでアクセスを制限する</span></a></p>
The post <a href="https://choice-site.com/2012/09/28/%e6%8e%a5%e7%b6%9a%e5%85%83ip%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/">接続元IPでアクセスを制限する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related "><p class='my_h3'>こんな記事もおすすめ</p><ul><li><a href="https://choice-site.com/2012/10/01/rss%e3%83%95%e3%82%a3%e3%83%bc%e3%83%89%e3%82%92%e8%87%aa%e5%88%86%e3%81%ae%e3%82%b5%e3%82%a4%e3%83%88%e3%81%ab%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8b%e6%96%b9%e6%b3%95/"    ><span class="wherego_title">RSSフィードを自分のサイトに表示させる方法</span></a></li><li><a href="https://choice-site.com/2012/09/28/%e5%ad%98%e5%9c%a8%e3%81%97%e3%81%aa%e3%81%84%e3%83%a6%e3%83%bc%e3%82%b6%e3%81%b8%e3%81%ae%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b%e3%80%82/"    ><span class="wherego_title">存在しないユーザへのメール送信を制限する。</span></a></li><li><a href="https://choice-site.com/2013/11/21/%e3%80%8c%e6%89%8b%e5%8b%95%e3%81%ab%e3%82%88%e3%82%8b%e5%af%be%e7%ad%96%e3%80%8d%e3%82%92%e5%8f%97%e3%81%91%e3%81%a6%e5%86%8d%e5%af%a9%e6%9f%bb%e3%83%aa%e3%82%af%e3%82%a8%e3%82%b9%e3%83%88%e3%82%92/"    ><span class="wherego_title">「手動による対策」を受けて再審査リクエストをした</span></a></li></ul></div>]]></description>
										<content:encoded><![CDATA[<p>サーバのログを見ていると、あまり関わりのない国のIPから怪しげなアクセスが結構あったので、国別、あるいは、個別にIPを制限することにしました。</p>
<p>制限したいIPは変わることもあるし、国別に割り当てられているIPも変わるので、動的にデータを取得し、<a title=".htaccessのルールやiptablesで使うルールを簡単に作成するツール" href="http://choice-site.com/tools/ip.php">.htaccessのルールやiptablesで使うルールを簡単に作成するツール</a>を作ってみました。</p>
<p>よければ自己責任でご利用ください。</p>
<p>&nbsp;</p>The post <a href="https://choice-site.com/2012/09/28/%e6%8e%a5%e7%b6%9a%e5%85%83ip%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/">接続元IPでアクセスを制限する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related "><p class='my_h3'>こんな記事もおすすめ</p><ul><li><a href="https://choice-site.com/2012/10/01/rss%e3%83%95%e3%82%a3%e3%83%bc%e3%83%89%e3%82%92%e8%87%aa%e5%88%86%e3%81%ae%e3%82%b5%e3%82%a4%e3%83%88%e3%81%ab%e8%a1%a8%e7%a4%ba%e3%81%95%e3%81%9b%e3%82%8b%e6%96%b9%e6%b3%95/"    ><span class="wherego_title">RSSフィードを自分のサイトに表示させる方法</span></a></li><li><a href="https://choice-site.com/2012/09/28/%e5%ad%98%e5%9c%a8%e3%81%97%e3%81%aa%e3%81%84%e3%83%a6%e3%83%bc%e3%82%b6%e3%81%b8%e3%81%ae%e3%83%a1%e3%83%bc%e3%83%ab%e9%80%81%e4%bf%a1%e3%82%92%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b%e3%80%82/"    ><span class="wherego_title">存在しないユーザへのメール送信を制限する。</span></a></li><li><a href="https://choice-site.com/2013/11/21/%e3%80%8c%e6%89%8b%e5%8b%95%e3%81%ab%e3%82%88%e3%82%8b%e5%af%be%e7%ad%96%e3%80%8d%e3%82%92%e5%8f%97%e3%81%91%e3%81%a6%e5%86%8d%e5%af%a9%e6%9f%bb%e3%83%aa%e3%82%af%e3%82%a8%e3%82%b9%e3%83%88%e3%82%92/"    ><span class="wherego_title">「手動による対策」を受けて再審査リクエストをした</span></a></li></ul></div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>ユーザエージェントでアクセス制限する</title>
		<link>https://choice-site.com/2012/09/26/%e3%83%a6%e3%83%bc%e3%82%b6%e3%82%a8%e3%83%bc%e3%82%b8%e3%82%a7%e3%83%b3%e3%83%88%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/</link>
		
		<dc:creator><![CDATA[nakade]]></dc:creator>
		<pubDate>Wed, 26 Sep 2012 08:06:25 +0000</pubDate>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<category><![CDATA[robots.txt]]></category>
		<guid isPermaLink="false">http://choice-site.com/?p=283</guid>

					<description><![CDATA[<p>行儀の悪い検索ロボット（クローラ）のアクセスをユーザエージェントを使って制限する mod_rewriteルールとrobots.txtを簡単に生成できるツールを作ってみた。</p>
The post <a href="https://choice-site.com/2012/09/26/%e3%83%a6%e3%83%bc%e3%82%b6%e3%82%a8%e3%83%bc%e3%82%b8%e3%82%a7%e3%83%b3%e3%83%88%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/">ユーザエージェントでアクセス制限する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related"> </div>]]></description>
										<content:encoded><![CDATA[<p><a title="行儀の悪い検索ロボット（クローラ）のアクセスをユーザエージェントを使って制限する mod_rewriteルールとrobots.txtを簡単に生成できるツール" href="http://choice-site.com/tools/useragent.php">行儀の悪い検索ロボット（クローラ）のアクセスをユーザエージェントを使って制限する mod_rewriteルールとrobots.txtを簡単に生成できるツール</a>を作ってみた。</p>The post <a href="https://choice-site.com/2012/09/26/%e3%83%a6%e3%83%bc%e3%82%b6%e3%82%a8%e3%83%bc%e3%82%b8%e3%82%a7%e3%83%b3%e3%83%88%e3%81%a7%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9%e5%88%b6%e9%99%90%e3%81%99%e3%82%8b/">ユーザエージェントでアクセス制限する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related"> </div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>「WWWあり」と「WWWなし」を統一する</title>
		<link>https://choice-site.com/2012/09/25/%e3%80%8cwww%e3%81%82%e3%82%8a%e3%80%8d%e3%81%a8%e3%80%8cwww%e3%81%aa%e3%81%97%e3%80%8d%e3%82%92%e7%b5%b1%e4%b8%80%e3%81%99%e3%82%8b/</link>
		
		<dc:creator><![CDATA[nakade]]></dc:creator>
		<pubDate>Tue, 25 Sep 2012 04:23:00 +0000</pubDate>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<guid isPermaLink="false">http://choice-site.com/?p=261</guid>

					<description><![CDATA[<p>サーバの設定の事情で、http://www.example.comとhttp://example.comで同じコンテンツを表示するようになっていることがあります。この場合、検索エンジンから複製コンテンツということでマーク&#8230; <a class="more-link" href="https://choice-site.com/2012/09/25/%e3%80%8cwww%e3%81%82%e3%82%8a%e3%80%8d%e3%81%a8%e3%80%8cwww%e3%81%aa%e3%81%97%e3%80%8d%e3%82%92%e7%b5%b1%e4%b8%80%e3%81%99%e3%82%8b/">続きを読む <span class="screen-reader-text">「WWWあり」と「WWWなし」を統一する</span></a></p>
The post <a href="https://choice-site.com/2012/09/25/%e3%80%8cwww%e3%81%82%e3%82%8a%e3%80%8d%e3%81%a8%e3%80%8cwww%e3%81%aa%e3%81%97%e3%80%8d%e3%82%92%e7%b5%b1%e4%b8%80%e3%81%99%e3%82%8b/">「WWWあり」と「WWWなし」を統一する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related"> </div>]]></description>
										<content:encoded><![CDATA[<p>サーバの設定の事情で、http://www.example.comとhttp://example.comで同じコンテンツを表示するようになっていることがあります。この場合、検索エンジンから複製コンテンツということでマークされてしまう危険性があるので、「wwwあり」「wwwなし」を統一したほうがよいです。</p>
<p>なので、この<a title="ドメインを正規化するツール" href="http://choice-site.com/tools/canonical.php" target="_blank">ドメインを正規化するツール</a>を作ってみました。</p>The post <a href="https://choice-site.com/2012/09/25/%e3%80%8cwww%e3%81%82%e3%82%8a%e3%80%8d%e3%81%a8%e3%80%8cwww%e3%81%aa%e3%81%97%e3%80%8d%e3%82%92%e7%b5%b1%e4%b8%80%e3%81%99%e3%82%8b/">「WWWあり」と「WWWなし」を統一する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related"> </div>]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>画像ファイルへのホットリンクを禁止する</title>
		<link>https://choice-site.com/2012/09/24/%e7%94%bb%e5%83%8f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%b8%e3%81%ae%e3%83%9b%e3%83%83%e3%83%88%e3%83%aa%e3%83%b3%e3%82%af%e3%82%92%e7%a6%81%e6%ad%a2%e3%81%99%e3%82%8b/</link>
		
		<dc:creator><![CDATA[nakade]]></dc:creator>
		<pubDate>Mon, 24 Sep 2012 08:17:07 +0000</pubDate>
				<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod_rewrite]]></category>
		<guid isPermaLink="false">http://choice-site.com/?p=253</guid>

					<description><![CDATA[<p>mod_rewriteを使って、画像ファイルやCSS、PDFなどへのホットリンク（外部サイトからの直接呼び出し）を禁止する方法です。 例えば、拡張子が「css、gif、jpg、jpeg、js、pdf、png、ttf、da&#8230; <a class="more-link" href="https://choice-site.com/2012/09/24/%e7%94%bb%e5%83%8f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%b8%e3%81%ae%e3%83%9b%e3%83%83%e3%83%88%e3%83%aa%e3%83%b3%e3%82%af%e3%82%92%e7%a6%81%e6%ad%a2%e3%81%99%e3%82%8b/">続きを読む <span class="screen-reader-text">画像ファイルへのホットリンクを禁止する</span></a></p>
The post <a href="https://choice-site.com/2012/09/24/%e7%94%bb%e5%83%8f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%b8%e3%81%ae%e3%83%9b%e3%83%83%e3%83%88%e3%83%aa%e3%83%b3%e3%82%af%e3%82%92%e7%a6%81%e6%ad%a2%e3%81%99%e3%82%8b/">画像ファイルへのホットリンクを禁止する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related "><p class='my_h3'>こんな記事もおすすめ</p><ul><li><a href="https://choice-site.com/2013/02/28/mod_pagespeed%e3%81%a7%e7%94%bb%e5%83%8f%e3%81%be%e3%82%8f%e3%82%8a%e3%81%a7%e5%9b%b0%e3%81%a3%e3%81%9f/"    ><span class="wherego_title">mod_pagespeedで画像まわりで困った</span></a></li><li><a href="https://choice-site.com/2012/09/18/apache-version-2-2-3%e3%81%aebasic%e8%aa%8d%e8%a8%bc%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e5%87%ba%e3%82%8b/"    ><span class="wherego_title">Apache version 2.2.3のBasic認証でエラーが出る</span></a></li></ul></div>]]></description>
										<content:encoded><![CDATA[<p>mod_rewriteを使って、画像ファイルやCSS、PDFなどへのホットリンク（外部サイトからの直接呼び出し）を禁止する方法です。</p>
<p>例えば、拡張子が「css、gif、jpg、jpeg、js、pdf、png、ttf、dat」のファイルについては、ローカルホスト（http://127.0.0.1/ と http://choice-site.com/）からの呼び出しに制限する場合は以下のような記述を「.htaccess」ファイルに書けばよいです。</p>
<pre><IfModule mod_rewrite.c><br />RewriteEngine On<br />RewriteCond %{HTTP_REFERER} !^http://(.+\.)?127\.0\.0\.1/.*$ [NC]<br />RewriteCond %{HTTP_REFERER} !^http://(.+\.)?choice-site\.com/.*$ [NC]<br />RewriteRule \.(css|gif|jpg|jpeg|js|pdf|png|ttf|dat)$ - [F]<br /></IfModule></pre>
<p>※上記のmod_rewriteルールを簡単に作成できるツール「<a href="http://choice-site.com/tools/hotlink.php">ホットリンクを禁止するMOD_REWRITEルール簡単作成</a>」を作ってみました。</p>The post <a href="https://choice-site.com/2012/09/24/%e7%94%bb%e5%83%8f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%b8%e3%81%ae%e3%83%9b%e3%83%83%e3%83%88%e3%83%aa%e3%83%b3%e3%82%af%e3%82%92%e7%a6%81%e6%ad%a2%e3%81%99%e3%82%8b/">画像ファイルへのホットリンクを禁止する</a> first appeared on <a href="https://choice-site.com">CHOICE</a>.<div class="wherego_related "><p class='my_h3'>こんな記事もおすすめ</p><ul><li><a href="https://choice-site.com/2013/02/28/mod_pagespeed%e3%81%a7%e7%94%bb%e5%83%8f%e3%81%be%e3%82%8f%e3%82%8a%e3%81%a7%e5%9b%b0%e3%81%a3%e3%81%9f/"    ><span class="wherego_title">mod_pagespeedで画像まわりで困った</span></a></li><li><a href="https://choice-site.com/2012/09/18/apache-version-2-2-3%e3%81%aebasic%e8%aa%8d%e8%a8%bc%e3%81%a7%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%8c%e5%87%ba%e3%82%8b/"    ><span class="wherego_title">Apache version 2.2.3のBasic認証でエラーが出る</span></a></li></ul></div>]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
