<?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>CSS-TricksCSS-Tricks</title>
	<atom:link href="http://css-tricks.com/htaccess-snippets-feed/" rel="self" type="application/rss+xml" />
	<link>http://css-tricks.com</link>
	<description>Tips, Tricks, and Techniques on using Cascading Style Sheets.</description>
	<lastBuildDate>Thu, 23 May 2013 19:15:16 +0000</lastBuildDate>
	<language></language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>

	<generator>http://wordpress.org/?v=3.5.1</generator>

	
		<item>
			<title>Append / Prepend Files</title>
			<link>http://css-tricks.com/snippets/htaccess/append-prepend-files/</link>
			<comments>http://css-tricks.com/snippets/htaccess/append-prepend-files/#comments</comments>
			<pubDate>Wed, 05 Oct 2011 12:26:04 +0000</pubDate>
			<dc:creator>Chris Coyier</dc:creator>
				<guid isPermaLink="false">http://css-tricks.com/?page_id=14472</guid>

			<description><![CDATA[<p>Rather than having to call / include a file you need on every single page, you can have them automatically prepended (top of file) or appended (bottom of file) automatically through your .htaccess file.</p>
<code>php_value auto_prepend_file "/real/path/to/file/functions.php"
php_value auto_append_file "/real/path/to/file/footer.php"&#8230;</code>]]></description>

			<content:encoded><![CDATA[<p>Rather than having to call / include a file you need on every single page, you can have them automatically prepended (top of file) or appended (bottom of file) automatically through your .htaccess file.</p>
<pre rel="HTAccess"><code>php_value auto_prepend_file "/real/path/to/file/functions.php"
php_value auto_append_file "/real/path/to/file/footer.php"</code></pre>
]]></content:encoded>

			<wfw:commentRss>http://css-tricks.com/snippets/htaccess/append-prepend-files/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>

						
		</item>

	
		<item>
			<title>Subdirectories URL Internally Redirect to Query String</title>
			<link>http://css-tricks.com/snippets/htaccess/subdirectories-redirect-query-string/</link>
			<comments>http://css-tricks.com/snippets/htaccess/subdirectories-redirect-query-string/#comments</comments>
			<pubDate>Fri, 06 Aug 2010 03:17:13 +0000</pubDate>
			<dc:creator>Chris Coyier</dc:creator>
				<guid isPermaLink="false">http://css-tricks.com/</guid>

			<description><![CDATA[<p><strong>The URL in the browser would be:</strong></p>
<p>http://css-tricks.com/index.php/teachers/a/</p>
<p><strong>The actual page rendered by the server would be:</strong></p>
<p>http://css-tricks.com/index.php?search=teachers&#038;sort=a</p>
<code class="htaccess">RewriteEngine on
RewriteRule ^index/([^/]+)/([^/]+).php /page.php?search=$1&#38;sort=$2 [NC]&#8230;</code>]]></description>

			<content:encoded><![CDATA[<p><strong>The URL in the browser would be:</strong></p>
<p>http://css-tricks.com/index.php/teachers/a/</p>
<p><strong>The actual page rendered by the server would be:</strong></p>
<p>http://css-tricks.com/index.php?search=teachers&#038;sort=a</p>
<pre><code class="htaccess">RewriteEngine on
RewriteRule ^index/([^/]+)/([^/]+).php /page.php?search=$1&amp;sort=$2 [NC]</code></pre>
]]></content:encoded>

			<wfw:commentRss>http://css-tricks.com/snippets/htaccess/subdirectories-redirect-query-string/feed/</wfw:commentRss>
			<slash:comments>21</slash:comments>

						
		</item>

	
		<item>
			<title>PHP Error Logging</title>
			<link>http://css-tricks.com/snippets/htaccess/php-error-logging/</link>
			<comments>http://css-tricks.com/snippets/htaccess/php-error-logging/#comments</comments>
			<pubDate>Mon, 14 Jun 2010 00:29:45 +0000</pubDate>
			<dc:creator>Chris Coyier</dc:creator>
			<category><![CDATA[Article]]></category>
			<guid isPermaLink="false">http://css-tricks.com/?page_id=6589</guid>

			<description><![CDATA[<p>Log errors to a file, and prevent showing them to the user. Make sure that the file exists and youre able to write to it.</p>
<code class="htaccess"># display no errs to user
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
# log to file
php_flag log_errors on
php_value error_log /location/to/php_error.log&#8230;</code>]]></description>

			<content:encoded><![CDATA[<p>Log errors to a file, and prevent showing them to the user. Make sure that the file exists and youre able to write to it.</p>
<pre><code class="htaccess"># display no errs to user
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
# log to file
php_flag log_errors on
php_value error_log /location/to/php_error.log</code></pre>
]]></content:encoded>

			<wfw:commentRss>http://css-tricks.com/snippets/htaccess/php-error-logging/feed/</wfw:commentRss>
			<slash:comments>11</slash:comments>

						
		</item>

	
		<item>
			<title>iPad Detection</title>
			<link>http://css-tricks.com/snippets/htaccess/ipad-detection/</link>
			<comments>http://css-tricks.com/snippets/htaccess/ipad-detection/#comments</comments>
			<pubDate>Fri, 23 Apr 2010 19:22:48 +0000</pubDate>
			<dc:creator>Chris Coyier</dc:creator>
			<category><![CDATA[Article]]></category>
			<guid isPermaLink="false">http://css-tricks.com/?page_id=6256</guid>

			<description><![CDATA[<p>Of course, the iPad is a pretty large screen and a fully capable browser, so most websites don't need to have iPad specific versions of them. But if you need to, you can detect for it with .htaccess</p>
<code class="htaccess">RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]</code>
<p>This will redirect iPad users to a URL you specify. This is probably the best way to do it (assuming you are running an Apache server), but if you aren't, there are <a href="http://davidwalsh.name/detect-ipad">PHP and JavaScript </a>&#8230;</p>]]></description>

			<content:encoded><![CDATA[<p>Of course, the iPad is a pretty large screen and a fully capable browser, so most websites don't need to have iPad specific versions of them. But if you need to, you can detect for it with .htaccess</p>
<pre><code class="htaccess">RewriteCond %{HTTP_USER_AGENT} ^.*iPad.*$
RewriteRule ^(.*)$ http://ipad.yourdomain.com [R=301]</code></pre>
<p>This will redirect iPad users to a URL you specify. This is probably the best way to do it (assuming you are running an Apache server), but if you aren't, there are <a href="http://davidwalsh.name/detect-ipad">PHP and JavaScript methods here</a>. </p>
]]></content:encoded>

			<wfw:commentRss>http://css-tricks.com/snippets/htaccess/ipad-detection/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>

						
		</item>

	
		<item>
			<title>Force Correct content-type for XHTML Documents</title>
			<link>http://css-tricks.com/snippets/htaccess/force-correct-content-type-for-xhtml-documents/</link>
			<comments>http://css-tricks.com/snippets/htaccess/force-correct-content-type-for-xhtml-documents/#comments</comments>
			<pubDate>Wed, 07 Apr 2010 18:17:00 +0000</pubDate>
			<dc:creator>Chris Coyier</dc:creator>
			<category><![CDATA[Article]]></category>
			<guid isPermaLink="false">http://css-tricks.com/?page_id=6140</guid>

			<description><![CDATA[<p>Most webservers serve XHTML content as text/html what is definitly the right way to handle XHTML documents. In case the server isn't doing that correctly, you can force it on Apache servers with .htaccess:</p>
<code class="htaccess">RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* - "[T=application/xhtml+xml; charset=ISO-8859-1]"&#8230;</code>]]></description>

			<content:encoded><![CDATA[<p>Most webservers serve XHTML content as <tt>text/html</tt> what is definitly the right way to handle XHTML documents. In case the server isn't doing that correctly, you can force it on Apache servers with .htaccess:</p>
<pre><code class="htaccess">RewriteEngine On
RewriteCond %{HTTP_ACCEPT} application/xhtml\+xml
RewriteCond %{HTTP_ACCEPT} !application/xhtml\+xml\s*;\s*q=0
RewriteCond %{REQUEST_URI} \.html$
RewriteCond %{THE_REQUEST} HTTP/1\.1
RewriteRule .* - "[T=application/xhtml+xml; charset=ISO-8859-1]"</code></pre>
]]></content:encoded>

			<wfw:commentRss>http://css-tricks.com/snippets/htaccess/force-correct-content-type-for-xhtml-documents/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>

						
		</item>

	
</channel>

</rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk (User agent is rejected)
Content Delivery Network via cdn.css-tricks.com

 Served from: css-tricks.com @ 2013-05-23 14:25:08 by W3 Total Cache -->