Easy Permalinks in IIS
-
I created a small php script to get “pretty” permalinks working on my site (www.unfocus.com), and thought I’d share. I created a file called wp-404-handler.php in the root of my wordpress installation (it’s my main root, but this should work in a sub directory as well) and put this in it:
<?php
$_SERVER[‘REQUEST_URI’] = substr($_SERVER[‘QUERY_STRING’], strpos($_SERVER[‘QUERY_STRING’], ‘:80’)+3);
$_SERVER[‘PATH_INFO’] = $_SERVER[‘REQUEST_URI’];
include(‘index.php’);
?>Then in iis I set a custom 404 handler to redirect (it may not call it that in the various control panels, but that’s what it’s called in IIS) to /wp-404-handler.php . This is also nice because now I have a 404 page that matches the rest of my site.
I hope this is helpful for someone.
- The topic ‘Easy Permalinks in IIS’ is closed to new replies.