Support » Fixing WordPress » IIS and permalink problems

  • Hi,
    I am having trouble with permalinks and IIS.

    When I setup my permalinks to CUSTOM:

    And I try and access my site:

    I get a 404 error. Now I see the post at the home page, this only when I click on the post to bring it up individually. Also, trying to access the categories without a post doesn’t work.

    I have, of course, followed the advice for changing the php.ini file to include:

    cgi.fix_pathinfo = 1
    cgi.force_redirect = 0

    I found a fairly good article:

    but it seems to require a costly ISAPI_rewrite.

    Is this really the only option?

    Although I have read a few articles, I am a bit confused about what the problem is. Can someone explain this problem?

    Also, what does the index.php have to do with the link. As you can see, my links don’t include that. I tried putting the index.php into it, and it fails with a different error: No input file specified.

    Any help would be appreciated.


Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m glad you found my article. There is apparently a free version of ISAPI_rewrite you could try. I’ve seen another article that mentioned using 404 error code rules in IIS to handle things, but this requires direct access to the IIS server settings, which is not something I have access to so I didn’t investigate this option (or keep the link).

    The problem is as follows: the web server needs to execute the index.php file no matter what your URL is. The remainder of the URL after the index.php is read by the WordPress code and the correct data is returned to be displayed in your browser. With permalinks, the index.php file is not included in the URL, so you need to rewrite the URL to include the index.php, so the web browser knows to execute it.

    This is why your home page works, but not the rest. Going to the page causes index.php to be invoked by default, which displays the home page. As an example of this, instead of trying a URL, try inserting index.php after the like so: This should correctly display the desired content, because URL rewriting is no longer needed because you manually rewrote the URL to include the index.php.

    – Basil

    Thank you for your reply (sorry for the delay – work and all ๐Ÿ˜‰

    So, I began with a brand new site/db. I created a couple of categories, and made a few posts in the categories to run some tests.

    Note, my \Windows\php.ini file has been modified to:
    cgi.fix_pathinfo = 1
    cgi.force_redirect = 0

    I then modified my permalinks to
    Date and name based

    I don’t intend to use this permanently, but just as a test.

    Now, when I click a post, the URL generate is:
    And the response is:
    No input file specified.
    Which doesn’t appear to be a 500 error as you suggest in your notes.

    Now I haven’t put any rewrite rules in
    C:\Program Files\Helicon\ISAPI_Rewrite\httpd.ini
    So, a failure is expected. However, I was expecting a different failure from the notes.

    Which leads me to the next question. It appears that these rewrite rules should be created for me by wordpress. However that is not the case in on my page. That is, it looks like:
    <?php if ( $permalink_structure && !$usingpi && !$writable ) : ?>
    is not TRUE in wp-admin\options-permalink.php

    I am not familiar with php, so I don’t know how to debug the script and figure out which variable is causing the problem.

    Is there a common reason why this would not be the case for windows/iis setup? And why it would not dump my rewrite rules on the webpage?

    Any thoughts here?

    Hmm, I’m not sure what’s going on. It looks like IIS isn’t picking up your php.ini file – it may be in the wrong directory. I believe it needs to be in your root website directory.

    It did not work for me wither on a windows server.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘IIS and permalink problems’ is closed to new replies.