<?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>Random and Irrelevant &#187; mod_rewrite</title>
	<atom:link href="http://sgp.me.uk/tag/mod_rewrite/feed/" rel="self" type="application/rss+xml" />
	<link>http://sgp.me.uk</link>
	<description>Sam Pearson&#039;s weblog - irrelevant content randomly updated</description>
	<lastBuildDate>Fri, 18 Nov 2011 18:06:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Technical Notes</title>
		<link>http://sgp.me.uk/2005/06/06/site-notes/</link>
		<comments>http://sgp.me.uk/2005/06/06/site-notes/#comments</comments>
		<pubDate>Mon, 06 Jun 2005 19:40:45 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Geekery]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Blosxom]]></category>
		<category><![CDATA[mod_rewrite]]></category>

		<guid isPermaLink="false">http://sgp.me.uk/2005/06/06/site-notes</guid>
		<description><![CDATA[This website is constructed with the help of <a href="http://www.apache.org/" title="The Apache Software Foundation">Apache</a>, <a href="http://www.blosxom.com/" title="Blosxom Prime">Blosxom</a> (with several plugins), <a href="http://sgp.me.uk/sam/2005/06/07/javascript-mailto" title="Javascript mailto links">a bit of javascript</a> and <a href="http://www.webstandards.org/" title="The Web Standards Project">Web Standards</a>.  It is very much a work in progress, but then point me to a weblog that isn't.  Here are some notes on the techniques used here. <a href="http://sgp.me.uk/2005/06/06/site-notes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>This website is constructed with the help of <a title="The Apache Software Foundation" href="http://www.apache.org/">Apache</a>, <a title="Blosxom Prime" href="http://www.blosxom.com/">Blosxom</a> (with several plugins), <a title="Javascript mailto links" href="http://sgp.me.uk/sam/2005/06/07/javascript-mailto">a bit of javascript</a> and <a title="The Web Standards Project" href="http://www.webstandards.org/">Web Standards</a>.  It is very much a work in progress, but then point me to a weblog that isn&#8217;t.  Here are some notes on the techniques used here.</p>
<h3>Apache tricks</h3>
<p>I use a couple of simple <code>.htaccess</code> tricks to help create more human-friendly <abbr title="Uniform Resource Locator">URL</abbr>s.   Most of these hacks use <code>mod_rewrite</code>, and none are particularly esoteric.   The comments in the following extract from the site-wide <code>.htaccess</code> should explain what&#8217;s going on:</p>
<pre><code># This little trick allows me to rename the blosxom
# script from the cumbersome script.cgi format to
# something simpler (in this case, 'sam'):

  SetHandler cgi-script

# Rewrite rules:
RewriteEngine On

# As I prefer to use just 'sgp.me.uk' as the base
# domain, this rule redirects requests for
# 'www.sgp.me.uk'.  This both allows the use of the
# 'www.' prefix while hopefully encouraging people
# not to use it by visibly redirecting rather than
# simply rewriting.
RewriteCond %{HTTP_HOST} ^www\.sgp\.me\.uk$ [NC]
RewriteRule ^(.*)$ http://sgp.me.uk/$1 [R=301,L]

# Pages devoted to baby photos have been integrated
# into my blog. This rule preserves the old
# hierarchy and provides me with a really simple
# URL to point family to for these photos:
RewriteRule ^uma(.*)$ /sam/uma$1

# I liked the idea of losing the required
# 'index.$flavour' suffixes for rss feeds:
RewriteRule ^sam(.*)/rss$ /sam$1/index.rss
RewriteRule ^sam(.*)/rdf$ /sam$1/index.rdf</code></pre>
<h3>Blosxom configuration</h3>
<p>The site uses Blosxom 2.0.  The script has been slightly modified to remove the code used to escape <abbr title="HyperText Markup Language">HTML</abbr> when outputting <abbr title="Really Simple Syndication|RDF Site Summary">RSS</abbr> (<a title="Auto escaping HTML in RSS with blosxom" href="http://sgp.me.uk/sam/2005/04/16/auto-escaping-html">see this post</a> for more information on this and a patch).  I also use the following plugins, some of which I wrote myself:</p>
<ul>
<li><a href="http://sgp.me.uk/sam/2005/08/04/atom-for-blosxom">atomfeed</a></li>
<li><a href="http://www.rho.org.uk/blosxom/plugins/cooluri">cooluri</a></li>
<li><a href="http://www.blosxom.com/downloads/plugins/entries_index">entries_index</a></li>
<li><a href="http://fletcher.freeshell.org/computers/web/blosxom/find">find</a></li>
<li><a href="http://www.blosxom.com/downloads/plugins/flavourdir">flavourdir</a></li>
<li><a href="http://fletcher.freeshell.org/wiki/HidePlugin">hide</a> (<a href="http://sgp.me.uk/sam/2005/04/17/hide-with-date-urls">modified</a>)</li>
<li><a href="http://www.cobblers.net/files/lastmodified">lastmodified</a></li>
<li>logger (Awaiting write-up.  An old version can be found <a href="http://sgp.me.uk/files/blosxom_plugins/logger">here</a>.)</li>
<li><a href="http://sgp.me.uk/files/nice_title">nice_title</a></li>
<li><a href="http://www.blosxom.com/downloads/plugins/rss10">rss10</a></li>
<li><a href="http://sgp.me.uk/sam/2005/06/06/xhtml-mime-plugin">xhtmlmime</a></li>
</ul>
<h3>Standards</h3>
<p>The website is designed to be accessible in all of the major browsers (having said that, it does render best in <a title="Get Firefox!" href="http://www.mozilla.org/products/firefox/">Firefox</a> because of <code>-moz-border-radius</code>).  It uses vaguely semantic HTML for structure and <abbr title="Cascading Style Sheets">CSS</abbr> for layout.  The HTML template is written to validate against the <abbr title="eXtensible Hypertext Markup Language">XHTML</abbr> 1.0 Strict Doctype, and the <code>xhtmlmime</code> plugin means that non-well-formed entries quickly get picked up.  The RSS feeds are all validated against the <a title="Validate your Feeds!" href="http://feedvalidator.org/">Feed Validator</a> from time to time.</p>
<h3>To do</h3>
<ul>
<li><del>application/xhtml+xml</del> &#8211; <a href="http://sgp.me.uk/sam/2005/06/06/xhtml-mime-plugin">done</a>!</li>
<li><del>Sort out some better page titles</del> &#8211; <a href="http://sgp.me.uk/files/nice_title">done</a>!</li>
<li>Comments/Writebacks</li>
<li>Tags (think <a title="Social Bookmarks" href="http://del.icio.us">del.icio.us</a>).  Probably implement this using a hacked version of the <a href="http://www.blosxom.com/downloads/plugins/meta">meta plugin</a></li>
<li><del><a title="AtomEnabled.org" href="http://www.atomenabled.org/">Atom</a> feed, once the spec is finalised</del> &#8211; <a href="http://sgp.me.uk/sam/2005/08/04/atom-for-blosxom">done</a>!</li>
<li>More stuff as I think of it</li>
<li>Oh yeah, actually post some <em>real content</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sgp.me.uk/2005/06/06/site-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

