WordPress.org

Ready to get started?Download WordPress

Forums

Day and name Permalinks results in 404 error (61 posts)

  1. smrtalex
    Member
    Posted 5 years ago #

    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?

  2. smrtalex
    Member
    Posted 5 years ago #

    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?

  3. meesha
    Member
    Posted 5 years ago #

    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.

  4. smrtalex
    Member
    Posted 5 years ago #

    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.

  5. smrtalex
    Member
    Posted 5 years ago #

    Any one?

  6. meesha
    Member
    Posted 5 years ago #

    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.

  7. smrtalex
    Member
    Posted 5 years ago #

    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?

  8. meesha
    Member
    Posted 5 years ago #

    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.

  9. smrtalex
    Member
    Posted 5 years ago #

    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!

  10. smrtalex
    Member
    Posted 5 years ago #

    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. :(

  11. antiresearch
    Member
    Posted 5 years ago #

    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.

  12. smrtalex
    Member
    Posted 5 years ago #

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

  13. MichaelH
    Member
    Posted 5 years ago #

    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.

  14. smrtalex
    Member
    Posted 5 years ago #

    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. :(

  15. MichaelH
    Member
    Posted 5 years ago #

    What if you switch to PHP 5?

  16. smrtalex
    Member
    Posted 5 years ago #

    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.

  17. eaglenick
    Member
    Posted 5 years ago #

    As Meesha said, there is something conflicting. The code that's in your .htaccess file is correct and should result in working permalinks.
    Is that the only code in your .htaccess file or is there something else in it?

  18. antiresearch
    Member
    Posted 5 years ago #

    Can't speak for smrtalex, but there's nothing else in my .htaccess file, aside from the code quoted above.
    Although I did try adding
    Options +FollowSymLinks
    to no avail.
    Just to be clear, the 404 is within WP, not coming from Apache, and post links work again when switched back to default.
    Thanks for all your help, everyone.

  19. smrtalex
    Member
    Posted 5 years ago #

    As with antiresearch, that is the only code in the .htaccess file. I have even cleaned it of any whitespace. And also just to be clear, like antiresearch, the 404 is within WP, not coming from Apache, and post links work again when switched back to default.

  20. gm10gm10
    Member
    Posted 5 years ago #

    Same problem is here. A new clean installation. No .htaccess. No plugins. Getting 404 every time when go away from default links.

    If it of any help, I checked error_log file in the root directory. It has a record repeated many times:
    --------------------
    [22-Dec-2008 15:18:51] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
    ---------------------

    Regards,

    gm

  21. MichaelH
    Member
    Posted 5 years ago #

    gm10gm10 - as suggested in the other thread, what does your host say about that error?

  22. gm10gm10
    Member
    Posted 5 years ago #

    Michael,

    I just opened a ticket. I did not mark it "urgent" so it may take a few hours. As soon as I get anything, I will post it in this thread.

  23. gm10gm10
    Member
    Posted 5 years ago #

    I got an email from tech support found that they fixed 404 problem. It did not fix WP though. I guess I have to wait until WP fixes its bug. No hurry for me since I was only attempting my first blog for a toy project.

  24. smrtalex
    Member
    Posted 5 years ago #

    Gotta agree with gm10gm10! There's a bug there somewhere. We'll just wait for an updated version and give it a try! Until then, we stick with 2.6.5.

  25. antiresearch
    Member
    Posted 5 years ago #

    Well, it's nice to not be alone...
    What does one do to get this on the list? The Trac is daunting to a newer user like myself.

  26. MichaelH
    Member
    Posted 5 years ago #

    Reporting Bugs explains how to report bugs. Use your forum login/password to login at Trac.

  27. gm10gm10
    Member
    Posted 5 years ago #

    >Well, it's nice to not be alone...

    I got 2.7 running flawlessly with another host and switched my account there.

    I can't blame the first host for the lack of attention, but the issue seems to needs higher level of support and a dedicated person. Instead I was getting a prompt reply day or night, but from different people. Some of them didn't even read my original ticket.

    One observation. The host where I could not get 2.7 working properly was ahead in upgrading its software. Linux kernel, PHP, MySQL all of them had slightly higher the version number. Just an observation since I don't know anything about all that software except it's involved in wp running.

    gm

  28. smrtalex
    Member
    Posted 5 years ago #

    gm10gm10,
    Would it be possible to post your Linux kernel, PHP, and MySQL versions, as well as the php settings, from your new hosting account?

    Or if anyone would post their php4 and php5 settings for a working 2.7, that would be great!

  29. smrtalex
    Member
    Posted 5 years ago #

    I have completely removed ALL files (including .htaccess) and databases from the domain I am working on. Restarted mysql and apache. My root directory is htdocs and I have created two diretories (wp6 and wp7) in htdocs.
    htdocs/
    htdocs/wp6
    htdocs/wp7

    I have put a phpinfo() file in all three directories and compared them. They are all three identical!

    I installed 2.6.5 in htdocs/wp6. Everything works as it should. Changed the permalinks settings in the admin area. .htaccess file is properly created. Tested the site and Permalinks functions as it should. No problems with 2.6.5.

    I installed 2.7 in htdocs/wp7. Everything works as it should. Changed the permalinks settings in the admin area. .htaccess file is properly created. Tested the site and get Error 404 - Not found.

    Does any one know if there anything in the database that could create the permalinks issue, or is permalinks completely controlled via the .htaccess file?

  30. smrtalex
    Member
    Posted 5 years ago #

    Here is what fixed this for me:

    In the 2.6.5 and 2.7 installation Permalinks settings I had Day and Name selected.

    I then went into the working 2.6.5 database wp_options table (via phpMyadmin) and searched for the "rewrite_rules" on the option_name field. I then copied the option_value of "rewrite_rules" (2.6.5) and then went to the 2.7 database and replaced the value that was in the 2.7 database with that of the 2.6.5 value.

    I then checked to see if I could change to the other permalinks settings and the 404 problem came back. So I changed my Permalink settings back to Day and Name, modified the database as above and the permalinks worked again.

    Seems like a bug to me.

    I am using php 4.4.9, apache 2.2.3, mysql 4.1.22

    Hope this helps others!

Topic Closed

This topic has been closed to new replies.

About this Topic