WordPress.org

Ready to get started?Download WordPress

Forums

IIS and permalink problems (5 posts)

  1. joshuaball
    Member
    Posted 8 years ago #

    Hi,
    I am having trouble with permalinks and IIS.

    When I setup my permalinks to CUSTOM:
    /%category%/%postname%.html

    And I try and access my site:
    http://foo.com/category/my-first-post.html

    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:
    http://www.basilv.com/psd/blog/2006/running-wordpress-20-under-iis

    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.

    Thanks.

  2. basilv
    Member
    Posted 8 years ago #

    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 http://www.foo.com causes index.php to be invoked by default, which displays the home page. As an example of this, instead of trying a URL http://www.foo.com/category/some-article.html, try inserting index.php after the foo.com like so:
    http://www.foo.com/index.php/category/some-article.html. 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

  3. joshuaball
    Member
    Posted 8 years ago #

    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
    ยป http://www.chezball.com/index.php/2006/02/10/sample-post/

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

    Now, when I click a post, the URL generate is: http://www.chezball.com/index.php/2006/02/10/child-cat-post/
    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?

  4. basilv
    Member
    Posted 8 years ago #

    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.

  5. mickej
    Member
    Posted 8 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic