« Adobe AIR gets a new logo
» ColdFusion Web hosting in the UK

Wordpress, PHP, SEO, Usability

Wordpress IIS permalinks using 404 redirect

12.04.07 | 1 Comment

Ok, I finally got this blog to have Search Engine friendly URL’s on a Windows 2003 server! I done a lot of searching and digging, but finally found this technique on Einar Egilsson’s Blog. The solution uses a custom 404 handler to complete the redirecting. Simply by adding this custom 404 page, your blog can be transformed into a search engine friendly haven of links. The steps are as follows … (once again compliments to Einar Egilsson)

Step 1: - Create a file called wp-404-handler.php. Inside the file, put the following code …

<?php
$qs = $_SERVER[’QUERY_STRING’];
$_SERVER[’REQUEST_URI’] = substr($qs, strpos($qs, ‘:80′)+3);
$_SERVER[’PATH_INFO’] = $_SERVER[’REQUEST_URI’];
include(’index.php’);
?>

Step 2: - Put this file into your blog web root

Step 3: - Update your 404 handler to point to your new “wp-404-handler.php” file.

Step 4: - Setup permalinks in your Wordpress Admin and put the following custom URL pattern …

/%year%/%monthnum%/%day%/%postname%/

Save your settings and Voila!! a new blog with lovely looking links :-)

1 Comment

have your say

Add your comment below, or trackback from your own site. Subscribe to these comments.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

:

:


« Adobe AIR gets a new logo
» ColdFusion Web hosting in the UK