[resolved] Permalinks not working without index.php in the url (10 posts)

  1. jjacobsen
    Posted 9 years ago #

    I've seen similar posts but no solution. If this hasn't been fixed, perhaps this will help?

    If my link looks like this then it will work:

    If I change the permalink to eliminate index.php then I get a WordPress 404 error:

    [and yes, htaccess is redirecting ok]

    I found a link to what was supposed to be a fixed copy of classes.php, but it appears that the problem is still there in the version that I downloaded.

    I put some debug code into classes.php and in the function parse_request() I find the following situation right before the comment that says "// The requested permalink is in $pathinfo for path info requests and in $req_uri for other requests"

    Using index.php $pathinfo = 2006/01.. $requri = index.php
    Without index.php $pathinfo = (blank) $requri = 2006/01..

    A few lines later in the code, the value of $request in both cases is 2006/01/13/hello-world so it would seem that they both should have the same result.

    However, when using index.php I notice a few lines later that the if statement with the comment "// If the requesting file is the anchor of the match, prepend it..." is executed and $request_match now contains the value index.php/2006/01.. while in the non-working case it remains the same as $request.

    (By the way, why is the if statement in the while loop? It executes multiple times)

    In any event, if $request_match contains "index.php" the permalink works and without it the 404 comes up.

  2. billdennis5
    Posted 9 years ago #

    I am havng the same probem at "http://peoriapundit.com/blogopeoria"!

    My permalinks go to a 500 server error. But if I manualy insert "index.php" before the "2006/01" in the URL in the address bar.

    I've also found it impossible to get into my admin pannel. I tried adding the "index.php" before "/wp-admin/", but it just shows the main page.

    This obviously isn't a matter of the DNS not being resolved.

  3. billdennis5
    Posted 9 years ago #

    This is all my .htaccess says:

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

    # END WordPress

  4. billdennis5
    Posted 9 years ago #

    Nevermind: I solved the problem by dumping 2.0 and installing 1.5.2.

  5. IAMalik
    Posted 9 years ago #

    If you go to options in the control panel, and change the permalink structure, it should work.

  6. jjacobsen
    Posted 9 years ago #

    Yes, it works fine if I use:

    But the structure I want to use doesn't work:

  7. IAMalik
    Posted 9 years ago #

    change the permalink structure to default, then change it back

  8. jjacobsen
    Posted 9 years ago #

    No luck. I think there is a problem in the version of classes.php that I have. If it has been fixed perhaps I just need to find the latest update.

    I guess I'll just use index.php as part of the URL for now and not worry about it.

  9. semperfidelis
    Posted 9 years ago #

  10. jjacobsen
    Posted 9 years ago #

    Problem solved!

    What I discovered is that when I change the permalink structure the old rewrite rules are still cached in the database and don't get updated.

    There is a record in the wp_options table with an index field called "option_name". I found the record with the option_name of "rewrite_rules" and set the option_value blank. That forced it to generate the new values and it started working immediately.

    I don't know why it didn't update when I change things in the control panel, but at least my problem is solved and it is working now.

Topic Closed

This topic has been closed to new replies.

About this Topic