WordPress Permalinks in Windows Using IIRF

November 19, 2009 | By

http://idealproteinrecipes.net/?options=Binary-Option-Most-Losses-In-A-Row-Bit Binary Option Most Losses In A Row Bit How To Borrow Money To Open A Restaurant http://agauchepress.com/?news=Best-Binary-Options-Graphs-300 Best Binary Options Graphs 300 Difference Of Stock Exchange From Forex Options Binary Options Trading In Central African Republic 2 Minute Strategy

Remove the www from the site name

The following lines remove the www from the site name. So if users enter www.codehill.com they will be redirected to http://codehill.com.

RewriteCond %{HTTP_HOST} ^www\.codehill\.com$ Difference Of Stock Exchange From Forex Options RedirectRule ^/(.*)$ http://codehill.com/$1 [R=301]


Excluding a Directory from Rewrite Rules

This line excludes the clients directory from any rewrite rules after it. I needed this because the clients directory has a separete application, and it didn’t need any rewriting.

RewriteRule ^/clients/(.*)$ – [L]



This line makes permalinks work. So far I tried it on 3 WordPress blogs and it worked without any changes.

RewriteRule ^/(?!index.php)(?!wp)([^\.]*)$ /index.php/$1 [I]


The Download Monitor Plugin

Download Monitor is a WordPress plugin for uploading and managing downloads.

RewriteRule ^/sourcecode/(.*)$ /wp-content/plugins/download-monitor/download.php?id=$1 [I]

Filed in: Windows Server, WordPress | Tags: , , , ,

Comments (6)

  1. WP User

    That was helpful, thanks.

  2. David Penrose

    Getting the following error when using this rule:

    CGI Error How To Borrow Money To Open A Restaurant The specified CGI application misbehaved by not returning a complete set of HTTP headers.

    I’m able to view pages under the wp- directories.

    iirf.ini: http://idealproteinrecipes.net/?options=Binary-Option-Most-Losses-In-A-Row-Bit Binary Option Most Losses In A Row Bit RewriteRule ^/(?!index.php)(?!wp)([^\.]*)$ /index.php/$1 [I]

    If I replace the above with:

    RewriteRule . /index.php [I]

    Public pages are then visible, albeit missing all styling from css. However, then unable to reach pages under wp- directories.

    Environ: IIS6
    Iirf.dll v2.0.1.15

    What am I doing wrong?

  3. @David the (?!wp) of the this line skips directories starting wp. Could you try one of the following lines BEFORE it:

    1) if you want www removed from the name:
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$
    RedirectRule ^/(.*)$ http://domain.com/$1 [R=301]

    2) if you want www added to name:
    RewriteCond %{HTTP_HOST} ^domain\.com$
    RedirectRule ^/(.*)$ http://www.domain.com/$1 [R=301]

    And make sure permalinks are enabled.

  4. This has been giving me grief, as have quite a few other things installing WordPress on an IIS6 / Dotnet server.

    This was the last step, to get the permalinks to work right. Thanks!

  5. Your are welcome philtronics. Glad you found the post useful 🙂

  6. Hello, i need some help, maybe you could help me.

    I have IIRF installed on http://biblioteca.koru.cl/ and

    I can enter to

    but it doesn’t work with


    I don’t know nothing about code, what should i add to mi IIRF.ini? Now i have this:

    RewriteEngine ON

    #Change the following to your renamed system folder path:
    RewriteRule ^/wp-content/(.*)$ /wp-content/$1 [I,L]

    #Rewrite wpcontent path (stylesheet, images, admin)
    RewriteRule ^/wp-(.*) /wp-$1 [I,L]

    # do not rewrite requests for stylesheets or image files
    RewriteRule ^/(css|img)/(.*)$ – [L,I]

    #This allows querystring to be added to the url (like {path=logout} )
    RewriteRule /(.*)\?(.*)$ /index.php\?q=$1&$2 [I,L]

    #This removes index.php? from the urls
    RewriteRule ^/(.*)$ /index.php?/$1 [I,L]