Support » Fixing WordPress » WordPress category gives 404 after moving to a different domain

  • Resolved Ashfame


    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 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?

Viewing 15 replies - 1 through 15 (of 33 total)
  • Any human response other than spamming me with something unrelated? Just for the record (incase this is human spam), I did use 301 redirect.

    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.

    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.

    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.

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

    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?

    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.

    No its in the root of the domain

    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.

    Moderator Ipstenu (Mika Epstein)


    Lead Plugin Wrangler

    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.

    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.

    Anything else that I can try?

    i had same issue so i know how it feels,

    give a try with this

    if your current mod rewrite is


    than remove slash from the end

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

    if your current mod rewrite is


    than add slash at the end. so it would be



    it did worked for me.

    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?

Viewing 15 replies - 1 through 15 (of 33 total)
  • The topic ‘WordPress category gives 404 after moving to a different domain’ is closed to new replies.