WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WP 2.0 messed up my permalinks (53 posts)

  1. mikae1
    Member
    Posted 8 years ago #

    Hi!

    Today I upgraded 1.5.2 to 2.0. After the upgrade my permalinks are not working at all. I get WP generated 404's on all pages. Once I set the permalink options to "Default" everything works fine again.

    After entering the permalink structure I used before the update (/%year%-%monthnum%/%postname%/) and pressing update I get 404's. I tried deleting the .htaccess (which I didn't keep from the 1.5.2 install, it must have been generated by 2.0), setting the permalink options to "Default" again and updating. After that I switched to "Custom" (/%year%-%monthnum%/%postname%/) again and updated to let WP write another .htaccess. This .htaccess reads:

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

    # END WordPress

    http://www.almehag.se/tmp/dump_env.html shows the base page generated by Dump Enviroment 1.0.1 (check the source) with the permalink structure I want to use enabled (/%year%-%monthnum%/%postname%/) if that helps anyone.

    Upping the old .htaccess I used for 1.5.2 again doesn't work either. You can check out my old htaccess here: http://www.almehag.se/tmp/htaccess.txt . It is for some reason substantially bigger than the new one that WP2 has generated.

    My blog is here (I've changed the permalinks to "Default" for now as nothing else works): http://blog.almehag.se/

    Any help appreciated, I'm quite frustrated.

    Thanks in advance...

  2. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    Looks like you have some redirection going from your subdomain to a subdirectory that breaks the new permalink processing. I sent you a patch that might help.

  3. mikae1
    Member
    Posted 8 years ago #

    Ryan solved the problem in a mail he sent to me.

    I updated these files:
    http://trac.wordpress.org/file/trunk/wp-includes/functions-post.php?rev=3390&format=raw
    http://trac.wordpress.org/file/trunk/wp-includes/classes.php?rev=3395&format=raw

    I then deleted the .htaccess and then went to "Customize Permalink Structure" and entered my /%year%-%monthnum%/%postname%/ format and clicked "Update Permalink Structure" so that WP would write a new .htaccess. That's it. Ryan is my idol! ;)

  4. vkaryl
    Member
    Posted 8 years ago #

    And thanks for reporting back! How about changing the dropdown at the top to "resolved"?

  5. mikae1
    Member
    Posted 8 years ago #

    Consider it done!

  6. vkaryl
    Member
    Posted 8 years ago #

    Thanks much, and have fun!

  7. apolaine
    Member
    Posted 8 years ago #

    This worked for me too, thanks so much, it was driving me insane. What exactly was the problem though and what was the fix in the patch?

  8. Austin Matzko
    Member
    Posted 8 years ago #

    yes, it would be helpful to know the exact nature of the problem so we could help others in similar situations.

  9. apolaine
    Member
    Posted 8 years ago #

    I wrote a post after upgrading painlessly (ironic eh?) and did a trackback to Lorelle. Fortunately she alerted me that the link was producing a 404 (an internal WP one). No idea why as all the other posts worked fine.

    Although I applied Ryan's patch above and it appeared to fix things, actually I'm not sure it made any difference. I made the classic bug-hunting error of changing two things at once. The timestamp in the trackback on Lorelle's site was dated one day later. it had the timestamp of 01/02 (2nd of January for us Europeans) but my post timestamp was 01/01 in my WP interface. No idea why that should be or how it happened. So I’m not sure if Ryan’s patch made any difference at all, but I’ll leave it in anyway. I re-stamped the post and it works, of course.

    Perhaps this is something wrong with the UTC calculations (my blog is hosted in the US but adjusted to Australian EST time and I'm currently posting from Germany)? Maybe just a lag in the trackback process that pushed it over the dateline?

    My post about tracking this down in the WP support threads and the original broken post (now fixed) are here.

    p.s. The RSS feed for this support thread doesn't seem to work for me.

  10. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    Here are the latest functions-post.php and classes.php. Those fix all permalink bugs that I am aware of. If you grabbed the classes.php mikae1 linked to above, please update to this classes.php. It fixes a paging bug.

    Copy those two files into wp-includes and then visit Options->Permalink to force the rewrite rule cache to update.

    Sorry for the permalink bugs. Supporting all of the different hosting environments is difficult.

  11. rogopag
    Member
    Posted 8 years ago #

    I uploaded the two files, deleted the old .htaccess and updated the permalinks structure to

    (/%year%/%monthnum%/%postname%/

    but still i get error 404.

    htaccess looks like this:

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

    # END WordPress

    Do i make something wrong?
    Thanks. ciao

  12. Ryan Boren
    WordPress Dev
    Posted 8 years ago #

    rogopag, to help me debug, download, install, and activate the Dump Env plugin. Visit a page that is giving a 404. Save the page source for that page. Forward the page source to ryan at boren dot nu. Deactivate the plugin when finished.

  13. sonria
    Member
    Posted 8 years ago #

    http://wordpress.org/support/topic/54547?replies=21#post-298784

    I should note that it is NOT my WP-generated 404 that is appearing.

  14. Aurlien
    Member
    Posted 8 years ago #

    I had the same problem.

    My blog http://blogpro.toutantic.net is hosted at textdrive.com.

    When I try to switch my permalink to "Date and name based" I get 404 from apache.
    I tried the latest functions-post.php and classes.php but the problem was still there...

    blogpro is a directory under my root...

    Went to Option page and modified it like this
    WordPress address (URI): http://toutantic.net/blogpro
    Blog address (URI): http://blogpro.toutantic.net

    It works!

    Just one problem left
    I canno't use the url http://blogpro.toutantic/net/wp-admin for administration I must use
    http://toutantic.net/blogpro/wp-admin

  15. rogopag
    Member
    Posted 8 years ago #

    hello ryan,

    sorry for the delay. I did what you ask me for and sent you the file. I hope is ok and useful.

    thank you for now, waiting for you.

    ciao. rogopag

  16. trib
    Member
    Posted 8 years ago #

    Ryan's patches have both worked and not worked for me...

    My Extended Live Archives were totally borked, and installing the patched files has brought it back to life. Hooray!

    However, The ability to generate a tag-based index when using anything other than the default URL format with Ultimate Tag Warrior is still broken. I am not sure of a solution on that at this point, but am talking with the plugin author, Christine, about it.

  17. Xander
    Member
    Posted 8 years ago #

    Either I'm crazy or the links to classes/functions-post up there just aren't working. Mighty peculiar, and my blog is now dead in the water. I hope a fix comes in soon!

  18. rogopag
    Member
    Posted 8 years ago #

    hello everybody davide mellis - http://dam.mellis.org/ - gave me the solution to my problems.

    select customize permalink structure and copy this:

    /index.php/%year%/%monthnum%/%day%/%postname%/

    it works and it's great!!

  19. kickass
    Member
    Posted 8 years ago #

    If the solution is there at dam.mellis.org I sure couldn't find it.

  20. vkaryl
    Member
    Posted 8 years ago #

    Well, the solution rogopag posted is the same one that's all over the place - whether dam.mellis.org or whatever....

    It's nothing more than the default structure with /index.php/ prepended - which doesn't always work either.

  21. Indie
    Member
    Posted 8 years ago #

    O.k., folks. My problem is sort of the same thing, but different. I'm able to change my permalinks to Numeric without any 404 error messages, but I lose my header image. The img src code still appears in the file, it just doesn't display. Any help would be greatly appreciated. Thanks.

    John

  22. moshu
    Member
    Posted 8 years ago #

    I can see it, if you mean the "barcode"-like jpg.

  23. Indie
    Member
    Posted 8 years ago #

    Right. It works on the front page only. However, if you click around, that barcode jpg disappears. I just adjusted the permalinks again so that you folks can observe the problem. Thanks for taking a look.

    John

  24. moshu
    Member
    Posted 8 years ago #

    Don't use relative path - it doesn't work with permalinks:
    on your main page
    http://indieretailer.com/
    the path to the image is /images/yourpic.jpg.
    so putting together it gives
    http://indieretailer.com/images/yourpic.jpg

    But when you go the the single post view:
    http://indieretailer.com/archives/13
    the path will become:
    http://indieretailer.com/archives/13/images/yourpic.jpg which obviously doesn't work.

  25. Indie
    Member
    Posted 8 years ago #

    o.k., thank you for the diagnosis. Forgive my ignorance, but how about a cure?

    John

  26. Indie
    Member
    Posted 8 years ago #

    Ummm... I think I got it. I'm not sure this is the best solution, but it certainly works. I changed the path in the header from img src="images/picture.jpg" to img src="http://www.indieretailer.com/images/picture.jpg"

    Thank you for the help.

    John

  27. lodlock
    Member
    Posted 8 years ago #

    I had a similar problem and went through every step located in this guide but nothing worked until I started disabling all of my plugins and found that the nice archive plugin was causing the inability to change pages. Try disabling it (if it's active and you have it) and see if it fixes your problem.

  28. Sachiel
    Member
    Posted 8 years ago #

    From the posts witten by Ryan, I understand that to fix this problem (that I'm suffering in http://sachiel.homelinux.net), I only have to replace my classes.php and functions-post.php for the versions he offers.

    I have tryed it, but the the web looks completely different, like printing the contents of these files. Am I missing something?

  29. mjr
    Member
    Posted 8 years ago #

    I'm having similar problems. I've made two posts using the default permalink structure, I then tried to change to a custom structure and I get 404s when clicking on the post titles. I've tried some of the suggestions posted here, but no luck.

  30. webseo
    Member
    Posted 8 years ago #

    I am also having the 404 problem with a fresh install of WP 2.0 (not an upgrade). The 404s are Apache. I have installed Ryan's patched files above (both versions) and only works on default or with index.php prepended.

    Does anyone have a fix for this?

    Thanks.

    martin
    webseo

Topic Closed

This topic has been closed to new replies.

About this Topic