WordPress.org

Support

Support » Installation » Day and name Permalinks results in 404 error

Day and name Permalinks results in 404 error

  • Having difficulties with Permalinks in 2.7.

    I have fresh installation of both 2.6.5 and 2.7 on a single domain. 2.6.5 in directory ‘wp6’ and 2.7 in directory ‘wp7’. Each on its own separate database. No plugins, themes, etc. I logged in the 2.6.5 installation, enabled permalinks, got code for the .htaccess and created the .htaccess file in the ‘wp6’ directory. 2.6.5 works great!!

    I did the same thing for 2.7, except put the 2.7 .htaccess code in the ‘wp7’ directory and when I try to click on a link, it gives me “Error 404 – Not Found”.

    Any thoughts as to what is going on?

Viewing 15 replies - 1 through 15 (of 60 total)
  • I also installed the latest trunk version:
    WordPress 2.8-bleeding-edge

    It has the same issues as 2.7.

    Anyone experiencing the same issue?

    Are you trying to switch from the “default permalinks” to “pretty permalinks”. Does everything work using the default permalinks?

    You said “got code for the .htaccess”, what code? I either start with a blank .htacess file or one that only has the code to correct the “http upload” error that happens when using the image upload manager.

    Make sure your .htaccess file is in the main directory for that version, wp7, and that it has correct permissions so that WP can add the “permalink rewrite rules” to it. If WP can’t rewrite that file, your pretty permalinks will fail.

    Download “AskApache RewriteRules Viewer” plugin, activate and look at what your .htaccess file really has in it. Plus it will tell you whether the .htacess file has the correct permissions.

    I’m trying to get 2.7 to work. So I will limit my comments to 2.7 since 2.6.5 I know already works.

    On the permalinks, I am switching from default to ‘Day and name’ in the Settings >> Permalinks in the admin area. When I click ‘Save Changes’, WordPress gives me the code that needs to be placed in the .htaccess file. I have put that code in the .htaccess file (that is the only code in the htaccess file) in the main directory of wp7. Here is the code that is in the file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wp7/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wp7/index.php [L]
    </IfModule>

    I have also made sure that any white space has been eliminated in the .htaccess code. In addition, I chmod 777 the .htaccess file.

    No plugins or themes, or anything has been installed or activated. And this is a FRESH NEW install.

    Any one?

    If you are in the 2.7 admin and switching from default permalinks (you didn’t say if the default was working or not) to Day and Name, and your .htaccess file was where it should be and correctly permissioned, you shouldn’t get a message from WordPress that gives you the code that needs to be placed in the .htaccess file.

    If your .htaccess file was in the correct folder and has the correct permissions then when you switch and save, WP will add the code for you. Since you are getting that message, then your .htaccess file is not correct and accessible to WP.

    Also, download that “AskApache RewriteRules Viewer” plugin, upload to server, activate and look at what your .htaccess file is really doing. It will show you what code is in it, what has been added by WP and whether the permissions are correct. One of the best plugins I can use when upgrading sites, takes the guesswork out of it.

    2.7 works fine with the default permalink settings.

    I was manaully putting the code in the .htaccess file. But I did change the permissions to 777 for .htaccess, changed to default permalinks. I then made sure the .htaccess file was empty but had 777 permissions. Also, the .htaccess is in the ‘wp7’ directory, which is where my 2.7 install is. At this point, 2.7 works as it should with default permalinks, and there is an empty .htaccess file with 777 permissions.

    I then changed the permalinks from default to ‘Day and name’ in the Settings >> Permalinks in the admin area, and clicked “Save Settings”. No code was shown for the .htaccess file. So I checked the .htaccess file and it had this in it:

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

    But as before, when I try to click on a link in WordPress, it gives me “Error 404 – Not Found”.

    As you suggested, I installed “AskApache RewriteRules Viewer” and it states the following:

    > Permalink: /%year%/%monthnum%/%day%/%postname%/
    > Writable .htaccess file found
    > mod_rewrite found
    > Not using pathinfo style index permalinks
    > Using mod_rewrite permalinks

    Any thoughts?

    You have done everything as I would have done. I really don’t know what to do next except deactivating all your plugins and try it that way. Something is conflicting and that is my only guess at this time. Pretty permalinks work on all my sites using what we have discussed, so haven’t had the experience of your error.

    If it was my site, I would also go to the new 2.7 “built-in” core upgrader and re-upgrade to 2.7 again just to make sure all the files are there. If you do, make sure you have the WP Automatic Upgrade Plugin deactivated, if you have it, as it’s not compatible with 2.7 now.

    Thanks! No plugins but the “AskApache RewriteRules Viewer” are installed or activated. This is Fresh install utilizing SVN. Maybe I will try a downloaded version. Thanks again!

    Just did a Fresh Install of 2.7 in wp7 directory from a .zip download. Created a blank .htaccess file in the wp7 directory and a new empty database and installed. Before I made any changes in the admin area, I tested the site. Everything worked as it should.
    I then changed the permalinks from default to ‘Day and name’ in the Settings >> Permalinks in the admin area, and clicked “Save Settings”. No code was shown for the .htaccess file. So I checked the .htaccess file and it had this in it:

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

    But as before, when I try to click on a link in WordPress, it gives me “Error 404 – Not Found”.

    Makes no sense, because I can to the same process above with a 2.6.5 version in the wp6 directory and everything works fine. 🙁

    I am having the same problem. I have tried the following:

    • Totally fresh WP 2.7 install in a new directory and new SQL database
    • htaccess permissions set to 666 and 777 (mine reads the same as above)
    • no plugins, templates, widgets etc

    The problem occurs immediately after install, right on the “Hello World” post.
    Default permalink structure acts as expected, but ANY custom structure leads to 404s.
    Any ideas would be greatly appreciated!
    Oh, and 2.6.x works fine for me too.

    Sorry! But glad to hear it not just me! Hopefully someone will come along with some more ideas! 🙂

    Could not duplicate your problem on my shared hosting test-bed. Even setup 2.7 to run in a sub-folder of the domain root as you seem to have done. Askapache rewrite shows exact same values you describe above.

    phpinfo returns:

    Linux 2.6.9-78.0.8.ELsmp

    _SERVER[“SERVER_SOFTWARE”]
    Apache/1.3.41 (Unix) mod_fastcgi/2.4.2 PHP/4.4.9 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_auth_passthrough/1.8 FrontPage/5.0.2.2635 mod_ssl/2.8.31 OpenSSL/0.9.7a

    PHP Version 5.2.5

    Not sure if this is related…
    http://mu.wordpress.org/forums/topic.php?id=3285

    Might want to see if your host has anything to add.

    Thanks for the link. We have root SSH access, so we checked the httpd.conf file and it has:
    AllowOverride All
    in the root directory. So we are ok there.

    We are using RHEL 5.2 (2.6.18-92.1.10.el5) with php 4.4.9

    It is just weird that 2.6.5 will work fine, but 2.7 will not and they both utilize the same code in their respective .htaccess files for permalinks. 🙁

    What if you switch to PHP 5?

    Thought you would ask that! 🙂 Unfortunately, can’t switch that box to php5 yet!

    I did try to install 2.7 on another box with php 5.2.5, that is virtually setup the same as the box with php 4.4.9 and experienced the same issue. Permalinks did not work. 🙁 And just for giggles, I installed 2.6.5 and permalinks DID work!

    That box was a CentOS 5.2 (2.6.18-028stab053.17-ent) with php 5.2.5. Both boxes are Apache 2.2.3.

Viewing 15 replies - 1 through 15 (of 60 total)
  • The topic ‘Day and name Permalinks results in 404 error’ is closed to new replies.