wp_url_rewriting:URL Rewriting for WordPress under IIS (V 2.1)

This ISAPI filter removes the index.php from WordPress permalinks on Windows IIS,making your permalinks more pretty and SEO friendly.

Because IIS does not support mod_rewrite module for rewriting URLs, if you are running WordPress on Windows IIS,whenever you try to use Permalinks, you always get something like this:

http://www.yourdomain.com/index.php/2006/09/02/…../

this ISAPI filter can remove ugly "index.php" from the URL automatically.it’s easy to use,just install it and no further configuration is necessary.

download wp_url_rewriting

Key benefits:

  • Speed.

    this URL Rewriting engine is writing in C++,because it’s designed dedicated for WordPress,so the program’s logic is very simple and no regular expression is used.it’s extremely faster than other rewriting engines on the IIS platform.
  • Support Multiple WordPress sites on one server.
  • No configuration is needed

    This URL Rewriting engine will automatically detect all WordPress sites on your server,and generate URL rewriting rules for each of them.

Living Demo

You can take my site as a living demo, navigate through my sites,watch the ‘pretty’ address in the browser.

Limitation

You must have administrator privileges on the target server in order to install this plugin.

Installation

1). Copy wp-url-rewriting.dll to the target machine and register it as an ISAPI filter using IIS MMC snap-in. wp-url-rewriting.dll can be registered at either the site level or the global level.Note:if WordPress is not installed in the root directory of your site,you should setup it as a virtual directory.

2). after register,Login to your WordPress admin panel->options->Permalinks,make sure you have removed the index.php from your permalink structure.

3). Do a little hack to WordPress file ‘link-template.php’ to make paging works well for categories:(NOTE: You don’t need to do this step if you are using WordPress 2.3.0 or newer)

open file /wp-includes/link-template.php and find the following code:

function get_pagenum_link($pagenum = 1) {

 global $wp_rewrite;

 $qstr = $_SERVER['REQUEST_URI'];

 $page_querystring = "paged";

 ...

}


Replace it with:

function get_pagenum_link($pagenum = 1) {

 global $wp_rewrite;

 $qstr = $_SERVER['PATH_INFO'];

 $page_querystring = "paged";

 ...

}

Revision History

  • version 2.1 -2007-8-29
    • Fixed a bug that may cause rewriting failed if there are many blogs under a single site.
  • version 2.0 -2007-8-17
    • no configuration file needed.This version automatically generate URL rewriting rules for each WordPress sites on the same server.
    • Support multiple WordPress sites on the same server.you can install this filter at the global level to support multiple WordPress sites on your server.
  • version 1.1 – 2006-11-1
    • optimize algorithm.
    • exclude directories : wp-admin,wp-content from the url rewriting rules.
  • version 1.0 – 2006-9-2
    • Initial Version

this ISAPI filter has been build with /MT switch(multithread, static CRT) ,if you failed to load this plugin,download vcredist_x86.exe from microsoft,run it on the target computer,this installs all Visual C++ libraries as shared assemblies.

Please feel free to report any bugs.

This project is licensed under GNU General Public License 2.0.

Related posts:

TAGS: , , , , , , ,


457 Comments »

Rado On January 25th, 2007 at 4:38 am (#)

Hi there,

This looks like an excellent extension, I’ve got a question though. Is it supposed to work with WordPress 2.x, or does it only support WordPress 1.x? I’m running WP 2.0.7, and while some of the links work properly (links to posts and categories) some do not work at all (entries feed, comments feed).

I was looking at the logfiles and noticed that your plugin is trying to redirect the RSS links to /wp-feed.php, whereas WP 2 seems to work with a different path to RSS feeds: index.php?feed=rss2. Is there a workaround or am I doing something wrong? Anyone else had the same issue?

Thanks,
Rado

Patty’s Blog » Archive » go On January 17th, 2007 at 11:30 pm (#)

[...] he following Plugins assist with the [...]

Dean Lee On January 11th, 2007 at 12:11 pm (#)

Lew A

currently,this plugin doesn’t support multiple virtual directories.I’ll consider to add this feature in the next version,thanks for your comments.

fountain spa youth On January 6th, 2007 at 9:21 pm (#)

fountain spa youth

url rewriting for wordpress under iis : dean lee:/dev/blog

jenna jameson brianna On January 6th, 2007 at 2:43 pm (#)

jenna jameson brianna

url rewriting for wordpress under iis : dean lee:/dev/blog

Lew A On January 5th, 2007 at 1:47 am (#)

Does the config.ini allow for multiple virtual directories?

For example our structure looks similar to this:
http://www.domain.com
http://www.domain.com/test1/
http://www.domain.com/test2/ (WordPress Site)
http://www.domain.com/test3/
http://www.domain.com/test4/ (WordPress Site)

So the config.ini would need to look like this:
/test2/
/test4/

Is this at all possible?

Thanks,
Lew A

GAURY On December 25th, 2006 at 10:33 pm (#)

It’s Wonderful;
I’ll come back to IIS( I’m using Apache2 now )

kaletra On December 19th, 2006 at 10:01 pm (#)

kaletra

URL Rewriting for WordPress under IIS : DEAN LEE:/DEV/BLOG

brown swim vix wear On December 19th, 2006 at 12:17 pm (#)

brown swim vix wear

URL Rewriting for WordPress under IIS : DEAN LEE:/DEV/BLOG

Quang On December 15th, 2006 at 11:04 pm (#)

I have download this isapi filter and followed instructions from http://www.juryriggin.com/2006/11/07/fixing-permalinks-when-using-wordpress-windows-2003-iis-60/. My permalink structure is /%postname%/. I have also made the corrections to config.ini with /advice/. I have also set cgi.force_redirect = 0 and cgi.fix_pathinfo = 1 in my php.ini. I have also tried putting a php.ini in the root of my website with cgi.force_redirect = 0 and cgi.fix_pathinfo = 1.

Everything works except the paging at the bottom of my blog. Navigating “Previous Entries” and “Next Entries” (in my case “Previous Page” and “next Page”) still includes “index.php” in the URL. Am I missing something, because as I am using this blog as the author says to do as a living demo, and I do not see “index.php” in his paging. All the URLs in this blog are pretty.

Is anyone else experiencing the same issue as I am? Any suggestions or input are greatly appreciated.

My blog is located at http://www.healthinsurancefinders.com/advice/


Leave a comment


(will not be published)