• Hi there,
    A new WP user here, with a fresh 2.0 install on IIS (bar a few bug fix updates).

    I’m trying to get permalinks working with ISAPI_rewrite, using the information I’ve gathered from the forums and other general searching (eg: http://www.selbmag.co.uk/2005/10/wordpress-and-isapi_rewrite/ ).

    I have verified that rewriting is working by creating custom rules for the pages on my site, like so:

    RewriteRule /contact/ /?page_id=4 [I,U,O]

    However, I cannot get any other url to work, particularly the blog pages. They are working if I just send a basic querystring link, however using permalinks or the index.php/year/month/etc method both fail.

    Does anybody have any suggestions?

    Also, is there a way of replicating the .htaccess rules WP uses as standard with a ISAPI_rewrite httpd.ini file:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php
    </IfModule>
    # END WordPress

    If this works for mod_rewrite, is there any chance a similar set could be created for ISAPI_rewrite?

    Thanks for any assistance.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I’ve recently gotten WordPress 2.0 working under IIS with permalinks. My blog article has all the details.

    Thread Starter gwynperry

    (@gwynperry)

    That’s really helpful. Thanks!

    One more question regarding permalinks:
    I’m now implementing my rule set, but I have no way of knowing if it is working properly. I often end up getting unexpected results, like empty pages (with the template). Is there a way of checking what has actually been rewritten? Can I see what querystring is being written by my rule set? It would really help with debugging my rules.

    I’m thinking something along the lines of a WP template tag or function. Any suggestions?

    Thanks again for your help.

    Glad I could help. Unfortunately, I too could have used a way of debugging the rewrite rules, but didn’t find an approach. The <a href=”http://dev.wp-plugins.org/browser/dump_env/
    “>Debug Env plugin may help with your blank page problem, but I haven’t tried it myself.

    It should be fairly easy to modify index.php to log or write out in a html comment the full URL. Of course, if a rule is wrong, index.php may not be invoked.

    I suspect getting IIS or the ISA_Rewrite module to log what its doing (if it can) is the way to go, but I don’t know how or whether its possible in a hosted environment.

    Thread Starter gwynperry

    (@gwynperry)

    The good news is, your rules appear to work like a dream, after I modded them to my requirements. I’m still having problems in some places, but those are of my own making (hackish templating).

    If ISAPI_rewrite is making a log then it isn’t appearing in my webroot, only an empty httpd.parse.errors file. Earlier on my host mentioned something about having seen a URL that I had tried to rewrite, so they must have access to some sort of log, but not me it seems.

    The blank page problem was a result of trying to devise my own rules and making a mess of it. When I dropped yours in and adapted them to my site, things started working just fine.

    The access log produced by IIS will show each URL accessed after rewriting and the HTTP status code associated with it. I’m not sure if you can access the raw log or not (My hosting company does provide such access). That may help a little, although its hard sometimes which line in the log corresponds to what experiment you tried.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Help with IIS, ISAPI_rewrite & permalinks’ is closed to new replies.