<?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>HattaraTecLog &#187; .htaccess</title>
	<atom:link href="http://teclog.hattara.info/?feed=rss2&#038;tag=htaccess" rel="self" type="application/rss+xml" />
	<link>http://teclog.hattara.info</link>
	<description>LinuxネタとかPHPネタとかの技術ログ</description>
	<lastBuildDate>Tue, 18 Nov 2014 12:15:20 +0000</lastBuildDate>
	<language>ja</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.8</generator>
	<item>
		<title>XMLを表示できない。</title>
		<link>http://teclog.hattara.info/?p=82</link>
		<comments>http://teclog.hattara.info/?p=82#comments</comments>
		<pubDate>Mon, 27 Apr 2009 11:16:21 +0000</pubDate>
		<dc:creator><![CDATA[hattara]]></dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[ZF]]></category>

		<guid isPermaLink="false">http://teclog.hattara.info/?p=82</guid>
		<description><![CDATA[ZendFrameworkの勉強と称して、PHPからXMLを表示しようとしてたわけですが、 XML表示ができず [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>ZendFrameworkの勉強と称して、PHPからXMLを表示しようとしてたわけですが、<br />
XML表示ができずに、以下のようなエラーが出てました。</p>
<blockquote><p>
XML パースエラー: タグの対応が間違っています。終了タグが必要です: </br><br />
URL: http://zend.hattara.info/Response/<br />
行番号: 11, 列番号: 3:<br />
</body><br />
&#8211;^
</p></blockquote>
<p>色々周りの方に確認してもらったりしたら、間違いがボロボロと。。。</p>
<ul type="square">
<li>ZendFrameworkでは、Controller部分には、phpの閉じかっこ「 ?> 」は記載しないらしい</li>
<li>XMLを表示する際には、タグの中はシングルクォートではなく、ダブルクォートを利用するらしい</li>
<li>「<?xml ～ ?>」は「<? ～ ?>」と競合するので、short_open_tagはOffにする必要があるらしい</li>
<li>charsetをUTF-8にしてるのに、ソースをEUCで記載してたので出たらしい</li>
</ul>
<p>というあたりがありました。<br />
なので、.htaccessで以下を追加したり各内容を修正したりしました。</p>
<blockquote><p>
php_value short_open_tag &#8220;Off&#8221;
</p></blockquote>
<p>この辺を全部対応して、どうにか動くようになりました。</p>
]]></content:encoded>
			<wfw:commentRss>http://teclog.hattara.info/?feed=rss2&#038;p=82</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccessで基本だけど忘れる事</title>
		<link>http://teclog.hattara.info/?p=55</link>
		<comments>http://teclog.hattara.info/?p=55#comments</comments>
		<pubDate>Wed, 05 Nov 2008 10:58:43 +0000</pubDate>
		<dc:creator><![CDATA[hattara]]></dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[IP制限]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://teclog.hattara.info/?p=55</guid>
		<description><![CDATA[よく.htaccessを使うわけだけども、その都度書き方をググるわけです。 面倒なんで、メモで残しておきます。 [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>よく.htaccessを使うわけだけども、その都度書き方をググるわけです。<br />
面倒なんで、メモで残しておきます。</p>
<p>まず、特定ホストからのみアクセスを許可するなら、</p>
<blockquote><p>
order deny,allow<br />
deny from all<br />
allow from 192.168.0.100<br />
allow from 192.168.0.200
</p></blockquote>
<p>みたいな感じにすれば、OKですね。</p>
<p>次に、mod_rewriteで転送する場合ですが、アクセスホスト名毎に<br />
内容を分岐する(VirtualHostとか使ってない場合?)とか、<br />
コンテンツ内容によって変更する場合には、以下のような書き方でいけますね。</p>
<p>## シンボリックリンクを有効に（場合によって不要かも）</p>
<blockquote><p>
Options FollowSymLinks
</p></blockquote>
<p>## リライトのエンジンを有効に。</p>
<blockquote><p>
RewriteEngine on
</p></blockquote>
<p>## サイト名A宛でtest.phpでもtest/フォルダでもなければmainフォルダに転送</p>
<blockquote><p>
RewriteCond %{HTTP_HOST} a.com<br />
RewriteCond %{REQUEST_URI} !(^/test\.php)<br />
RewriteCond %{REQUEST_URI} !(^/test/)<br />
RewriteRule ^(.*)$ /main/ [R]
</p></blockquote>
<p>## サイトB宛で/aaa/abc.php宛のものを defフォルダに転送</p>
<blockquote><p>
RewriteCond %{HTTP_HOST} b.com<br />
RewriteCond %{REQUEST_URI} (^/aaa/abc.php)<br />
RewriteRule ^(.*)$ /def/ [R]
</p></blockquote>
<p>というような感じでできますね。<br />
あとは、これをもとの修正をいれてあげればいい感じ。</p>
<p>条件とか不要な場合には、Redirectを使えばいいですね。</p>
]]></content:encoded>
			<wfw:commentRss>http://teclog.hattara.info/?feed=rss2&#038;p=55</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CGI版PHPについて</title>
		<link>http://teclog.hattara.info/?p=39</link>
		<comments>http://teclog.hattara.info/?p=39#comments</comments>
		<pubDate>Tue, 14 Oct 2008 11:48:49 +0000</pubDate>
		<dc:creator><![CDATA[hattara]]></dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[CGI版]]></category>
		<category><![CDATA[ini_set]]></category>
		<category><![CDATA[php_value]]></category>

		<guid isPermaLink="false">http://teclog.hattara.info/?p=39</guid>
		<description><![CDATA[モジュール版ではなく、CGI版のPhpを使う場合、 (レンタルサーバを利用中でCGI版になってる場合）には、  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>モジュール版ではなく、CGI版のPhpを使う場合、<br />
(レンタルサーバを利用中でCGI版になってる場合）には、<br />
特に何も設定をしなかった場合には、<br />
phpの環境変数(php.iniで設定されてるもの)を変更できない。</p>
<p>モジュール版の場合には、.htaccessに「php_value」を書いてみたり<br />
phpのソース（たとえばtest.phpみたいな）ものの中で「ini_set」をして<br />
設定を上書きすることができる(1部の設定を除く)わけですが、<br />
CGI版ではできないようですね。</p>
<p>phpinfoでみても「local」の部分が書き変わってないので、<br />
効いてないってことですね。</p>
<p>実際に試してみましたが、できませんでした。</p>
<p>これを回避する一般的な方法としては、suPHPを利用する形っぽいですね。</p>
<p>詳細は以下のサイトにのってるようですぜ。</p>
<p><a href="http://matsui.homeunix.com/index.php?FreeBSD%2FsuPHP">FlatEight.com >> FreeBSD/suPHP</a></p>
]]></content:encoded>
			<wfw:commentRss>http://teclog.hattara.info/?feed=rss2&#038;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
