<?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; .htaccess</title>
	<atom:link href="http://www.lazydada.com/tag/htaccess/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, 03 Aug 2010 18:01:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Keeping your sites optimised</title>
		<link>http://www.lazydada.com/2009-06-11/keeping-your-sites-optimised/</link>
		<comments>http://www.lazydada.com/2009-06-11/keeping-your-sites-optimised/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 09:16:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Optimisation]]></category>
		<category><![CDATA[shadowbox]]></category>
		<category><![CDATA[Sprites]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=382</guid>
		<description><![CDATA[The sites I&#8217;ve been working on had been suffering from flab. A JavaScript library here (jQuery of course), a plug-in there, another, another, another&#8230; then a large plug-in that loads it&#8217;s own plug-ins (Shadowbox v3 &#8211; I&#8217;m talking to you). It took a kick form outside to realise things were going downhill. So &#8211; with [...]]]></description>
			<content:encoded><![CDATA[<p>The sites I&#8217;ve been working on had been suffering from flab. A JavaScript library here (<a href="http://jquery.com/">jQuery</a> of course), a plug-in there, another, another, another&#8230; then a large plug-in that loads it&#8217;s own plug-ins (<a href="http://www.shadowbox-js.com/">Shadowbox v3</a> &#8211; I&#8217;m talking to <em>you</em>). </p>
<p>It took a kick form outside to realise things were going downhill. </p>
<p>So &#8211; with the help of the good folk at <a href="http://developer.yahoo.com/yslow/">Yahoo YSlow</a> and the new copy-cat-kid on the block (<a href="http://code.google.com/speed/page-speed/">Google Page Speed</a>) with their plug-ins for a plug-in(<a href="http://www.getfirebug.com/">firebug</a>) for Firefox [oh the irony]&#8230; I&#8217;ve started to get things in line again.</p>
<p>Both YSlow and Page Speed have helpful links and information once called &#8211; and now I can pat myself on the back for having improved my YSlow scores from an &#8216;F&#8217; to a &#8216;B&#8217;. Wetware heh.  </p>
<p>Main issues I was able were too fix were too many HTTP requests and a lack of explicit caching direction from the web server. Nextly I&#8217;ll be looking at getting interface elements into a sprites for future jobs. (Must take this <a href="http://spritegen.website-performance.org/">sprite/CSS creation tool</a> for a spin. Looks absolutely fab.)</p>
<h3>Reduce HTTP requests</h3>
<p>While combining CSS files is trivial, combining a bunch of disparate JS files into one is not painless &#8211; I&#8217;ve had to drop a jQuery tooltip plug-in as it wouldn&#8217;t play nice when bundled up with its playground compatriots. </p>
<h3>Server side caching and compression</h3>
<p>is achieved the following htaccess rules: </p>
<pre>
##Cacheing static components

FileETag none
Header unset Etag

# Far future 1 YEAR
&lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4|css|js)$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
&lt;/FilesMatch>
&lt;FilesMatch "scripts.inc.php$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
&lt;/FilesMatch>

# Past last modified
&lt;FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4|css|js)$">
Header set last-modified "Sun, 13 Jul 2008 20:00:00 GMT"
&lt;/FilesMatch>
&lt;FilesMatch "scripts.inc.php$">
Header set last-modified "Sun, 13 Jul 2008 20:00:00 GMT"
&lt;/FilesMatch>

#Compress
&lt;IfModule mod_deflate.c>
&lt;FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
&lt;/FilesMatch>
&lt;/IfModule>
</pre>
<h3>Shadowbox woes</h3>
<p>I now may be on the lookout for a replacement to Shadowbox. Shadowbow v2 was great &#8211; it came with lots of build options and could be explicitly launched by jQuery on Document Ready. v2 wasn&#8217;t IE8 compatible however &#8211; forcing an upgrade to v3 &#8211; still in beta&#8230; Ho hum. This required an updated version of the <a href="http://www.longtailvideo.com/players/jw-flv-player/">JW FLV</a> media player which I&#8217;m not mad keen on &#8211; and that needs a new licence. While Shadowbox is now very clever and can automatically find it&#8217;s own dependencies &#8211; it has many of these &#8211; each one with an HTTP request. While it is easy to combine the whole bundle into a single file its something I&#8217;d rather not have to do/keep track of &#8211; I&#8217;ve already got a rod for my back with the other jQuery plugins&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-06-11/keeping-your-sites-optimised/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Display proper maintenance page with .htaccess</title>
		<link>http://www.lazydada.com/2009-06-08/display-proper-maintenance-page-with-htaccess/</link>
		<comments>http://www.lazydada.com/2009-06-08/display-proper-maintenance-page-with-htaccess/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 10:28:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[maintenance]]></category>
		<category><![CDATA[server side]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=359</guid>
		<description><![CDATA[Create a decent &#8220;sorry this site is down for maintenace&#8221; page with a &#8220;have a Nice day&#8221; message then when you do need to upgrade things use the following htaccess rewrite rule to forward all traffic to this page. Adapted from Marco’s Webdev Notepad RewriteEngine on RewriteCond %{REMOTE_ADDR} !^83\.57\.178\.37$ RewriteRule !maintenance/index.html /maintenance/index.html [L,NC,R=302] From Ask [...]]]></description>
			<content:encoded><![CDATA[<p>Create a decent &#8220;sorry this site is down for maintenace&#8221; page with a &#8220;have a Nice day&#8221; message then when you do need to upgrade things use the following htaccess rewrite rule to forward all traffic to this page.</p>
<p>Adapted from <a href="http://blog.t14g.de/index.php/archives/819">Marco’s Webdev Notepad</a></p>
<pre>RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^83\.57\.178\.37$
RewriteRule !maintenance/index.html /maintenance/index.html [L,NC,R=302]</pre>
<p>From <a href="http://www.askapache.com/">Ask Apache</a> (I like)</p>
<pre>ErrorDocument 403 http://www.sub.domain.com/
Order deny,allow
Deny from all
Allow from 83.57.178.37</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-06-08/display-proper-maintenance-page-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tiny URL?</title>
		<link>http://www.lazydada.com/2009-04-14/tiny-url/</link>
		<comments>http://www.lazydada.com/2009-04-14/tiny-url/#comments</comments>
		<pubDate>Tue, 14 Apr 2009 20:33:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Web design & development]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[URLs]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://www.lazydada.com/?p=266</guid>
		<description><![CDATA[Zeldman&#8217;s just posted about the current mini-storm about URL shortening services&#8230; I love his understated way. While the debate about these services &#8211; and, as an adjunct, feed scraping, we should look to our webdev monkey skills to roll our own solutions. He, yer Zeldman, doesn&#8217;t state as much in B&#38;W but his example shows [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zeldman.com/2009/04/14/tiny-url-big-trouble/">Zeldman&#8217;s</a> just posted about the current mini-storm about URL shortening services&#8230;  </p>
<p>I love his understated way. While the debate about these services &#8211; and, as an adjunct, <a href="http://twitter.com/hotdogsladies/status/1465570303">feed scraping</a>, we should look to our webdev monkey skills to roll our own solutions. He, yer Zeldman, doesn&#8217;t state as much in B&amp;W but <a href="http://twitter.com/zeldman/status/1478498391">his example</a> shows his own tiny URL. How? The simple redirect. </p>
<p>Whether or not this is done with a mod_rewrite rule or by any means necessary [dreams of CMS modules in my mind] &#8211; the fact is that it is easy a pie to make your own Tiny URLs and publish them hand in hand with the original article. Every article should have a permalink and a short version. </p>
<p>Of course &#8211; the redirect solution presupposes your domain isn&#8217;t <a href="http://en.wikipedia.org/wiki/Longest_word_in_English">www.pneumonoultramicroscopicsilicovolcanoconiosis.com</a>&hellip; </p>
]]></content:encoded>
			<wfw:commentRss>http://www.lazydada.com/2009-04-14/tiny-url/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess tips and tricks</title>
		<link>http://www.lazydada.com/2008-10-24/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! -->