<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Setting charset in htaccess</title>
	<atom:link href="http://www.askapache.com/htaccess/setting-charset-in-htaccess.html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html</link>
	<description>Web Development</description>
	<pubDate>Sun, 20 Jul 2008 16:56:05 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: brent</title>
		<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html#comment-39706</link>
		<dc:creator>brent</dc:creator>
		<pubDate>Wed, 23 Apr 2008 04:00:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/setting-charset-in-htaccess.html#comment-39706</guid>
		<description>wow this is huge, thanks!!  I didn't think they allowed me to have my own custom php.ini on dreamhost, -- it's not very well publicized

one question, you mentioned making the cgi-bin directory in my website's document root with this command:

&lt;pre&gt;mkdir -p cgi-bin&lt;/pre&gt;

I've already made a cgi-bin directory one directory before my website directory, this is where I have the python script I run to make my google sitemap.  Is this where I should be putting the files, or does it go into my website root?

I remember hearing somewhere that putting certain files in a webspace would be a security risk.

brent</description>
		<content:encoded><![CDATA[<p>wow this is huge, thanks!!  I didn&#8217;t think they allowed me to have my own custom php.ini on dreamhost, &#8212; it&#8217;s not very well publicized</p>
<p>one question, you mentioned making the cgi-bin directory in my website&#8217;s document root with this command:</p>
<pre>mkdir -p cgi-bin</pre>
<p>I&#8217;ve already made a cgi-bin directory one directory before my website directory, this is where I have the python script I run to make my google sitemap.  Is this where I should be putting the files, or does it go into my website root?</p>
<p>I remember hearing somewhere that putting certain files in a webspace would be a security risk.</p>
<p>brent</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html#comment-39648</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Tue, 22 Apr 2008 07:51:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/setting-charset-in-htaccess.html#comment-39648</guid>
		<description>@Brent

How in the world do you survive without a custom php.ini?  I run dreamhost as well and heres how to get running in 3 minutes.  First, login via ssh cd to your websites document root and then run these commands.

&lt;ol&gt;
&lt;li&gt;&lt;code&gt;mkdir -p cgi-bin&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cp -rp /dh/cgi-system/php5.cgi .&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;cp -rp /etc/php5/cgi/php.ini .&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

Now add this to your root .htaccess
&lt;pre&gt;&lt;br /&gt;
AddHandler php-cgi .php .htm&lt;br /&gt;
Action php-cgi /cgi-bin/php5.cgi&lt;br /&gt;
&lt;/pre&gt;

Ok?  Good now you can do everything I talk about.</description>
		<content:encoded><![CDATA[<p>@Brent</p>
<p>How in the world do you survive without a custom php.ini?  I run dreamhost as well and heres how to get running in 3 minutes.  First, login via ssh cd to your websites document root and then run these commands.</p>
<ol>
<li><code>mkdir -p cgi-bin</code></li>
<li><code>cp -rp /dh/cgi-system/php5.cgi .</code></li>
<li><code>cp -rp /etc/php5/cgi/php.ini .</code></li>
</ol>
<p>Now add this to your root .htaccess</p>
<pre>
AddHandler php-cgi .php .htm
Action php-cgi /cgi-bin/php5.cgi
</pre>
<p>Ok?  Good now you can do everything I talk about.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brent Lagerman</title>
		<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html#comment-39630</link>
		<dc:creator>Brent Lagerman</dc:creator>
		<pubDate>Tue, 22 Apr 2008 01:18:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/setting-charset-in-htaccess.html#comment-39630</guid>
		<description>Thanks so much for the followup

The problem is that I can't get to php.ini since I'm on a shared host (dreamhost) they run php as cgi.

I put these lines in the beginning of all the files and it seems to have worked,

&lt;pre&gt;header(&#039;Content-type: text/html; charset=UTF-8&#039;);&lt;/pre&gt;

but it'd be much nicer to use .htaccess or just have it declared once somewhere instead of on every file.

brent</description>
		<content:encoded><![CDATA[<p>Thanks so much for the followup</p>
<p>The problem is that I can&#8217;t get to php.ini since I&#8217;m on a shared host (dreamhost) they run php as cgi.</p>
<p>I put these lines in the beginning of all the files and it seems to have worked,</p>
<pre>header(&#039;Content-type: text/html; charset=UTF-8&#039;);</pre>
<p>but it&#8217;d be much nicer to use .htaccess or just have it declared once somewhere instead of on every file.</p>
<p>brent</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html#comment-39466</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Sat, 19 Apr 2008 04:03:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/setting-charset-in-htaccess.html#comment-39466</guid>
		<description>@ Brent ~

Another possibility is a small one but maybe its the problem.  Apache serves ErrorDocuments by default using iso, the same can be said for Apache-generated directory index pages.  Depending on the version of Apache you are using, you can change this.</description>
		<content:encoded><![CDATA[<p>@ Brent ~</p>
<p>Another possibility is a small one but maybe its the problem.  Apache serves ErrorDocuments by default using iso, the same can be said for Apache-generated directory index pages.  Depending on the version of Apache you are using, you can change this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: AskApache</title>
		<link>http://www.askapache.com/htaccess/setting-charset-in-htaccess.html#comment-39465</link>
		<dc:creator>AskApache</dc:creator>
		<pubDate>Sat, 19 Apr 2008 04:02:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.askapache.com.com/htaccess/setting-charset-in-htaccess.html#comment-39465</guid>
		<description>@ Brent, Binny V A ~

No this will not work for PHP.  Only static files.  The reason is because this is simply telling Apache to handle these files using the handler for them, while php files have their own handler, the php interpreter or cgi.  

So to get the charset correct for php files you need to modify your php.ini like so.

&lt;pre&gt;&lt;br /&gt;
default_mimetype = &#34;text/html&#34;&lt;br /&gt;
default_charset = &#34;UTF-8&#34;&lt;br /&gt;
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>@ Brent, Binny V A ~</p>
<p>No this will not work for PHP.  Only static files.  The reason is because this is simply telling Apache to handle these files using the handler for them, while php files have their own handler, the php interpreter or cgi.  </p>
<p>So to get the charset correct for php files you need to modify your php.ini like so.</p>
<pre>
default_mimetype = &quot;text/html&quot;
default_charset = &quot;UTF-8&quot;
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>
