<?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>Gabriel de Kadt &#187; redirects</title>
	<atom:link href="http://www.lazydada.com/tag/redirects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lazydada.com</link>
	<description>Personal notes on Mac based web development and design.</description>
	<lastBuildDate>Tue, 30 Aug 2011 10:47:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>.htaccess tips and tricks</title>
		<link>http://www.lazydada.com/2008-10-24/htaccess-tips-and-tricks/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=htaccess-tips-and-tricks</link>
		<comments>http://www.lazydada.com/2008-10-24/htaccess-tips-and-tricks/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 15:50:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[redirects]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=135</guid>
		<description><![CDATA[Rewrite We *heart* canonical URIs [Note - I've recently come accross a web hosting company that disallows Options +FollowSymLinks. When used their server throws an internal error page - you may need to replace with the more secure (on shared hosting systems anyway) Options +SymLinksIfOwnerMatch ] Get rid of those pesky Ws. RewriteEngine on Options [...]]]></description>
			<content:encoded><![CDATA[<h2>Rewrite</h2>
<h3>We *heart* canonical URIs</h3>
<p>[<strong>Note</strong> - I've recently come accross a web hosting company that disallows <code>Options +FollowSymLinks</code>. When used their server throws an internal error page - you may need to replace with the more secure (on shared hosting systems anyway) <code>Options +SymLinksIfOwnerMatch</code> ]</p>
<h4>Get rid of those pesky Ws.</h4>
<p><code>RewriteEngine on<br />
Options +FollowSymLinks<br />
RewriteCond %{HTTP_HOST} ^www.example\.co\.uk$ [NC]<br />
RewriteRule ^(.*)$ http://example.co.uk/$1 [R=301,L]</code></p>
<h4>Or as you may well prefer &#8211; reinstate them</h4>
<p>The SEO boys, they say &#8220;<strong>www</strong>&#8220;.</p>
<p><code>RewriteEngine on<br />
Options +FollowSymLinks<br />
RewriteCond %{HTTP_HOST} ^example\.co\.uk$ [NC]<br />
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [R=301,L]</code></p>
<h4>…rewrite continued:</h4>
<p><code>#redirect all .html pages to .php<br />
RewriteBase   /<br />
RewriteRule  ^(.*).html$ $1.php [R=301]</code></p>
<h2>Redirects</h2>
<p><code>#specific page redirects - PERMANENT<br />
redirect 301 /example-page.html http://example.com/new-name.html </code><br />
<code>#specific page redirects- TEMPORARY<br />
redirect 302 /example-page.html http://example.com/new-name.html </code></p>
<h2>Spell checker</h2>
<p>Thanks to <a href="http://meiert.com/en/blog/20070412/htaccess-7-useful-ingredients-plus-bonus/" target="_blank">Jens Meiert</a> This little line will allow a single typo in your users&#8217; URIs (guess who just discovered that &#8220;URL&#8221; is a depreciated term):<br />
<code>CheckSpelling On </code></p>
<h2>Get rid of any instances of &#8220;index.html&#8221;. And more</h2>
<p><code>RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /([^/]+/)*index.(html?|php) HTTP/<br />
RewriteRule ^(([^/]+/)*)index.(html?|php)$ http://example.com/$1 [R=301,L] </code></p>
<h2>Add trailing slashes where they may have been missed&#8230;</h2>
<p>Thanks to <a href="http://www.webmasterworld.com/apache/3312238.htm" target="_blank">Webmaster World</a></p>
<p><code># If final URL-path-part does not contain a period or end with a slash<br />
RewriteCond %{REQUEST_URI} !(\.[^/]*|/)$<br />
# Redirect to add a trailing slash<br />
RewriteRule (.*) http://www.example.com/$1/ [R=301,L]</code></p>
<h2>more&#8230;</h2>
<h3>Set PDFs to download rather than open in browser</h3>
<p><code>#option for PDFs to download rather than open<br />
AddType application/octet-stream .pdf </code></p>
<h3>Disable directory browsing</h3>
<p><code># disable directory browsing<br />
Options All -Indexes </code></p>
<h3>Redirect denied directory listings etc to standard error page</h3>
<p><code># redirect denied directory listings etc to standard error page<br />
ErrorDocument 403 /404-redirect.html<br />
ErrorDocument 404 /404-redirect.html </code></p>
<h3>Ease versioning of CSS files (+)</h3>
<h4>Will also improve history viewing with GitX</h4>
<p>Note: this assumes a naming convention of, for example <code>/css/filename.1234.css</code>. Other dots will break this fragile little fellow.<br />
<code>#Rules for Versioned Static Files<br />
RewriteRule ^(scripts|css)/(.+)\.(.+)\.(js|css)$ $1/$2.$4 [L]</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2008-10-24/htaccess-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
