Permalinks, IIS 6, PHP 5.2.1 (upgrade from 5.2.0) (10 posts)

  1. Jan Reilink
    Posted 9 years ago #

    [I hope "How-To and Trobleshooting is the correct forum for this...]


    Last week we, the hosting company I work for, upgraded from PHP version 5.2.0 to 5.2.1. And suddenly customers started complaining about permalinks stopped working and returning 404 errors. I am now trying to find the cause (probably changes in some of PHPs regular expression-like functions), but my guess is the WordPress developers here know more about the rewriting code of WordPress than I do to pinpoint it :)

    For my test purposes I have created two identical application folders with one difference: One of them uses PHP 5.2.0 and the other 5.2.1. They both use the same php.ini file. The phpinfo() information is located here:

    and both WordPress installations can are located here:

    As you can see, a permalink like
    works, and
    does not.

    We noticed the same behaviour with blogs/cms's like ExpressionEngine, which we could "fix" with ISAPI_Rewrite. But I have not tested that thoroughly...
    Is this a problem I (or better, the WordPress developers ;)) can fix by changing some code or functions? Or is this a problem with (some of) the PHP core fuctions which needs to be fixed by the PHP developers?

    If anyone is capable of rewriting the .htaccess rewrite rules to ISAPI_Rewrite (http://www.isapirewrite.com), I would be more than happy to test them :-) ISAPI_Rewrite support within WordPress (next to .htaccess) would be a nice addition, for websites hosted on Windows/IIS.

    Thank you in advance for any insights, pointers and/or help.

    Best regards,
    Jan Reilink, VEVIDA Services bv

  2. supercharged
    Posted 9 years ago #

    I found this thread on Google, and happen to be one of the affected customers. Some more Googling brought this up. Does that help?

  3. supercharged
    Posted 9 years ago #

    Downgrading to php 5.2.0 solved it.

  4. Craig3
    Posted 9 years ago #

    Take a look at IIS Mod-Rewrite. It's mod_rewrite compatible and it even supports .htaccess. Unfortunatelly it is commercial, so ask your provider if they can support it.

  5. Craig3
    Posted 9 years ago #

  6. mundi89
    Posted 9 years ago #

    If you can deal with the /index.php here is a solution that might help?

  7. Jan Reilink
    Posted 9 years ago #

    I believe to have permalinks properly function now. In cooperation with Helicon's ISAPI_Rewrite. I have made one code change to wp-includes\classes.php:

    // $req_uri = $_SERVER['REQUEST_URI'];
    $req_uri = $_SERVER['HTTP_X_REWRITE_URL'];
    (line 46) and with the follwing rewrite rules (which I found on the Helicon forum):
    # For file-based wordpress content (i.e. theme, admin, etc.)
    RewriteRule /php/wordpress/wp-(.*) /php/wordpress/wp-$1 [L]
    # For normal wordpress content, via index.php
    RewriteRule ^/php/wordpress/$ /php/wordpress/index.php [L]
    RewriteRule /php/wordpress/(.*) /php/wordpress/\?$1 [L]

    Example (only temporarily online):

  8. James Revillini
    Posted 8 years ago #

    Awesome - this method is still workin' in WP 2.3.1!

  9. mobilelibrary
    Posted 8 years ago #

    Hi Jan, thanx! I am one happy customer...

  10. zhrance
    Posted 8 years ago #

    Cheers Jan for your post,

    This problem gave me headaches and by using your .ini code it works!

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic