Got tired of my ASP version of “pretty permalinks” which liked to screw up every few hours (don’t even know why, gg Microsoft) so decided to pay one last visit to the Wordpress Permalinks wiki page. Found something I totally didn’t expect
A php version which so far is working beautifully! To use simply put the following in something like wp-404.php and stick it in the root of your blog. Then go into your control panel (or setup a .htaccess if you’re on *nix and permalinks aren’t working) to forward all 404 requests to that page. On Helm (and other control panels I’m guessing) it lets you choose between URL and File, choose URL as File is a littly iffy in my experience. Anyway, heres the code:
$qs = $_SERVER['QUERY_STRING'];
$_SERVER['REQUEST_URI'] = substr($qs, strpos($qs, ‘:80′)+3);
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];
include(’index.php’);
NOTE: Wordpress is removing the < ? php and ? > code markings from this post so be sure to stick it before $qs and after index.php’);…Again, be sure to put < ? php (no spaces) before $qs and ? > (again no spaces) after index.php’);