WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] WordPress category gives 404 after moving to a different domain (34 posts)

  1. Ashfame
    Member
    Posted 3 years ago #

    I just moved a site from one domain to another and now category links are all 404. I have flushed the rewrite rules, recreated the .htaccess file but still it throws up 404.

    Weird thing is that if I delete .htaccess file, then the posts are still accessible by domain.com/postname/ and when I save permalinks, then it is created there. So can it be the case it is using some other .htaccess file? Possibly some fallback that I am not aware of?

    Tag pages work fine. Also I am using a custom slug for category "cat" and not the default "category" but reverting to the default doesn't solve anything. Any clues?

    Edit: I saw Ipstenu's sticky and found that Advanced Permalinks are known to have a problem with WP 3.1, so I disabled it and recreated by permalinks but still no joy. What did I miss?

  2. Pigi_the_digg
    Member
    Posted 3 years ago #

  3. Ashfame
    Member
    Posted 3 years ago #

    Any human response other than spamming me with something unrelated? Just for the record (incase this is human spam), I did use 301 redirect.

  4. Ashfame
    Member
    Posted 3 years ago #

    Tag pages don't work fine. Its all weird. Tags generally give 404, one of them opened a non 404 page but not what it should be (i.e. posts listing under that tag). And a category redirects itself to one of the posts. This all led me to conclude that tags were working but they are not. Also everything works, when I turn off the permalinks.

    So far, I have tried recreating permalinks, flushing rewrite rules by calling global $wp_rewrite; $wp_rewrite->flush_rules(); in functions.php, deleting rewrite_rules in options table & even deleting .htaccess file. So I am clueless and would appreciate if someone can give me a clue how it can be fixed.

  5. Bill Erickson
    Member
    Posted 3 years ago #

    What happens if you change the permalink structure to the default (?p=123)?

    What happens if you add /index.php/ to the front of the permalink structure?

    If both of these work, then it sounds like your server doesn't support mod_rewrite, which is used to figure out what content needs to be loaded based on the pretty permalink.

  6. Ashfame
    Member
    Posted 3 years ago #

    Thanks for replying! Everything works fine with default permalinks. But when I turn them on, the issue comes up even on Twenty ten with zero plugins.

    I am sorry how do I add that exactly? - /index.php/

    the old site and new site both were in the same server and old one worked fine, so that rules out any issue from server side. I strongly feel it has something to do with rewrites.

  7. Ashfame
    Member
    Posted 3 years ago #

    Ok! I tried with /index.php/%postname%/ but still no joy! Issue persists.

  8. Ashfame
    Member
    Posted 3 years ago #

    If I delete the .htaccess file, the site behaves if it was there and I can browse pretty permalinks without any issue (.htaccess file is not there in the WP root) but when I resave permalinks, it is created there. So can there be some kind of fallback for .htaccess because this shouldn't be possible without rules in .htaccess?

  9. Bill Erickson
    Member
    Posted 3 years ago #

    Is WordPress installed at the top level or within a directory? If it's in a directory there might be an htaccess file in the directory above which is taking precedence.

  10. Ashfame
    Member
    Posted 3 years ago #

    No its in the root of the domain

  11. Bill Erickson
    Member
    Posted 3 years ago #

    Hmm, then I don't know. Maybe it's an issue with the host? Try duplicating the site on your local computer or another host to see if the issue persists.

    You've done everything I can think of.

  12. Did you let WORDPRESS recreate your .htacess? Also, what kind of server are you on? IIS has been acting up. There was more than just a list of plugins in the sticky, and as a handful of people have had this issues, i would check their posts as well.

    This is one of those things I've not been able to reproduce, but I did make a ticket for it.

  13. Ashfame
    Member
    Posted 3 years ago #

    Hi Ipstenu,

    The site is on Apache. And Yes, I deleted the .htaccess file and let it be recreated by WordPress.

    A worth mentioning point is that if I delete that .htaccess file, permalinks still work, as if WordPress don't care but I tried turning the rewrite engine off instead of on and then the permalinks failed. So, I guess that's something which can help discovering it.

    As a summary, I have done the following:

    • Recreated .htaccess by WP & manually
    • Flushed rewrite rules
    • Deleted rewrite_rules in options table

    And weird thing is, permalinks work even when I delete the .htaccess file manually.

  14. Ashfame
    Member
    Posted 3 years ago #

    Anything else that I can try?

  15. Vishal Barot
    Member
    Posted 3 years ago #

    i had same issue so i know how it feels,

    give a try with this

    if your current mod rewrite is

    /%category%/%postname%/

    than remove slash from the end

    so it would be /%category%/%postname%

    if your current mod rewrite is

    /%category%/%postname%

    than add slash at the end. so it would be

    like

    /%category%/%postname%/

    it did worked for me.

  16. Ashfame
    Member
    Posted 3 years ago #

    Thanks for responding!

    My permalink structure is /%postname%/

    So I tried saving it without a trailing slash (/%postname%), checked the category pages, no joy.

    Then I resaved them as /%postname%/ and then checked the category pages, still 404.

    What I am supposed to do if this can't be fixed now?

  17. Vishal Barot
    Member
    Posted 3 years ago #

    well..
    im not expert here,
    make new category and check if newly created cats work or not.

  18. Ashfame
    Member
    Posted 3 years ago #

    Tried, new category didn't work either.

  19. dremeda
    Sucuri Wizard
    Posted 3 years ago #

    Did you try manually reinstalling WordPress by chance?

  20. Ashfame
    Member
    Posted 3 years ago #

    Nope! I did try reinstalling from the dashboard itself. Should I try manually once? Manually files may be out of sync but WP upgrade shouldn't lost it. What say?

  21. dremeda
    Sucuri Wizard
    Posted 3 years ago #

    I'd give it a go to see if it remedies the issue. I have ran into a few similar problems since 3.1 and a fresh, manual install lead me down the right path.

    Cheers!

  22. Ashfame
    Member
    Posted 3 years ago #

    Tried that, still no joy! God, what's wrong with it?

  23. Reuben Gunday
    Member
    Posted 3 years ago #

    Pastebin rewrite_rules from options table

  24. Ashfame
    Member
    Posted 3 years ago #

    Sure! Here it is - http://pastebin.com/28yh7Tp9

    Pastebin ads are pushing the display under a hidden overflow, so please copy paste the raw text locally to see it.

  25. Ashfame
    Member
    Posted 3 years ago #

    Also, I saw _transient_rewrite_rules in the option table. Not sure if its a part of a WP standard install. So, I am pasting that too here - http://pastebin.com/44PXDVxL

  26. Reuben Gunday
    Member
    Posted 3 years ago #

    Are these rules with the patch applied from the ticket?

    The first rules don't seem to have category rules(maybe I'm missing something there) but the second rules contain category rules.

    A URL to your site would also be helpful.

  27. Ashfame
    Member
    Posted 3 years ago #

    I am sorry, those were without the patch applied (I reverted it back when it didn't make a difference). The site in question is http://phonerpt.com/

    And now with the patch in place, the rewrite rules are here - http://pastebin.com/xWzVbLsz
    and the _transient_rewrite_rules are here - http://pastebin.com/dvF9LhY9

    Edit: Even if I remove the category base and save permalinks, then too I get 404. I would like to remind that I was using Advanced Permalinks plugin when the site was upgraded and its known to cause issues with WP 3.1

  28. Reuben Gunday
    Member
    Posted 3 years ago #

    Do categories work with other permalink settings i.e /%year%/%monthnum%/%day%/%postname%/ ??

  29. Ashfame
    Member
    Posted 3 years ago #

    No they only works when permalinks are totally turned off to default (?p=3423)

  30. Reuben Gunday
    Member
    Posted 3 years ago #

    Did you try default theme(with all plugins deactivated)?
    Use debug bar plugin and see what is the query sql.

Topic Closed

This topic has been closed to new replies.

About this Topic