<?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/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>石間謙 勝手ブログ Ver.2.5 &#187; .htaccess</title>
	<atom:link href="http://jbar.jp/ishima/tag/htaccess/feed" rel="self" type="application/rss+xml" />
	<link>http://jbar.jp/ishima</link>
	<description>IT、iPhone、NOKIA、バー、日本酒、柏、冷麺、釣り、星、フードニングネタを書き綴るサイト</description>
	<lastBuildDate>Fri, 09 Dec 2011 05:25:05 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/tag/htaccess/feed" />
		<item>
		<title>.htaccessで掲示板のスパム対策</title>
		<link>http://jbar.jp/ishima/it/spam_htaccess.html</link>
		<comments>http://jbar.jp/ishima/it/spam_htaccess.html#comments</comments>
		<pubDate>Thu, 15 Oct 2009 06:37:36 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[スパム対策]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=313</guid>
		<description><![CDATA[100%のスパム対策というのはないですが、比較的簡単に.htaccessで掲示板のスパム対策を行なう方法。 特に掲示板利用者が日本人だけで、英語の書き込みは基本的にないという場合に有効。 .htaccessにAccept [...]]]></description>
			<content:encoded><![CDATA[<p>100%のスパム対策というのはないですが、比較的簡単に.htaccessで掲示板のスパム対策を行なう方法。<br />
特に掲示板利用者が日本人だけで、英語の書き込みは基本的にないという場合に有効。<br />
.htaccessにAccept-Languageで言語を日本語に絞ることである程度のスパム対策ができる。<br />
もちろん、スパムを送る側が上記のAccept-Languageへの対策を更に施していればこの.htaccessは意味がなくなるがが、ある程度の効果は見込める。</p>
<pre class="brush: php; title: ; notranslate">
SetEnvIf Accept-Language &quot;^[^(ja)]+$&quot; non_jp

order allow,deny
allow from all
deny from env=non_jp
</pre>
<p>上記以外にもロボットには意味がないが、JavaScriptを利用した画像認証「JCap」も結構使えます。<br />
<a href="http://jbar.jp/ishimaken/general/jcap.html">http://jbar.jp/ishimaken/general/jcap.html</a></p>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=313&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/it/spam_htaccess.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/it/spam_htaccess.html" />
	</item>
		<item>
		<title>Nucleusで特定のカテゴリのみhttps://にする</title>
		<link>http://jbar.jp/ishima/nucleus/https_on_nucleus.html</link>
		<comments>http://jbar.jp/ishima/nucleus/https_on_nucleus.html#comments</comments>
		<pubDate>Tue, 13 Oct 2009 05:12:52 +0000</pubDate>
		<dc:creator>石間</dc:creator>
				<category><![CDATA[Nucleus]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[https]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://jbar.jp/ishima/?p=284</guid>
		<description><![CDATA[久しぶりにNucleusネタ。 Nucleusで特定のカテゴリのみhttps://～にしたいときがある。 例えば問い合わせフォームなどをカテゴリ「問い合わせ」などとして作ってしまうような場合。 こういう時に、.htacc [...]]]></description>
			<content:encoded><![CDATA[<p>久しぶりにNucleusネタ。<br />
Nucleusで特定のカテゴリのみhttps://～にしたいときがある。<br />
例えば問い合わせフォームなどをカテゴリ「問い合わせ」などとして作ってしまうような場合。<br />
こういう時に、.htaccessとmod_rewriteが使える環境下なら下記のようにすれば特定のカテゴリのみhttps://～にすることができる。<br />
下記の例ではNucleusのcatidが15,16,17の時だけhttps://～になる。この知恵が出るまでに時間かかりましたが、できてしまうと便利です。</p>
<pre class="brush: php; title: ; notranslate">
RewriteEngine on

RewriteCond %{HTTPS} on
/*上の行が利かない場合は下記を試す*/
RewriteCond %{SERVER_PORT} !^80$
/**/

RewriteCond %{QUERY_STRING} !(catid=15)
RewriteCond %{QUERY_STRING} !(catid=16)
RewriteCond %{QUERY_STRING} !(catid=17)
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [R,L]

RewriteCond %{QUERY_STRING} catid=15[OR]
RewriteCond %{QUERY_STRING} catid=16[OR]
RewriteCond %{QUERY_STRING} catid=17[OR]
RewriteCond %{HTTPS} off
/*上の行が利かない場合は下記を試す*/
RewriteCond %{SERVER_PORT} ^80$
/**/
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

/*　特定のフォルダだけに適用する場合　（下記の例はdownloadフォルダ）*/
RewriteCond %{SERVER_PORT} ^80$
RewriteCond %{REQUEST_URI} ^/download/ [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</pre>
<img src="http://jbar.jp/ishima/?ak_action=api_record_view&id=284&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://jbar.jp/ishima/nucleus/https_on_nucleus.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://jbar.jp/ishima/nucleus/https_on_nucleus.html" />
	</item>
	</channel>
</rss>

