WordPress.org

Forums

[resolved] Moved blog, now 404 only on main blog page (24 posts)

  1. jedweb
    Member
    Posted 1 year ago #

    Everything is working fine except my main blog page results in a 404. The blog posts and main blog page are to be at mydomain.com/news/

    Prior to move:
    - static site at mydomain.com
    - WordPress blog at mydomain.com/news/

    Move steps:
    - created new WordPress blog at mydomain.com/test/
    - export from mydomain.com/news/
    - import result to mydomain.com/test/ (used WordPress Importer plugin)
    - create all static pages from mydomain.com in mydomain.com/test/ as pages
    - move files from mydomain.com/test/ to mydomain.com
    - renamed /news/ subdirectory to /newsOLD/
    - set permalink structure to /news/%postname% ( I want the blog part to continue to be at /news/ )

    After move:
    - all pages and posts work and display correctly
    - posts are correctly at mydomain.com/news/postname
    - post categories are correctly at mydomain.com/news/categoryname
    - etc.
    - however, going to mydomain.com/news/ (where main blog page should be) results in 404 page

    Notes:
    - I have the proper WordPress index.php in the root.
    - I have redirects in my htaccess to point the old static pages to the new WordPress pages but even with just the default WordPress htaccess the 404 occurs.
    - Site URL and WordPress URL in General Settings is mydomain.com
    - I checked the options table in the database and initially site_url was still set to mydomain.com/test/ but changing this had no effect
    - I'm not using any caching or redirect plugins

    Am I misunderstanding something here? Am I forgetting something? This should work, no?

    Thanks in advance for any insight.

  2. Tara
    Volunteer Moderator
    Posted 1 year ago #

  3. jedweb
    Member
    Posted 1 year ago #

    Thanks @Tara

    I've been through that page already and believe I've done everything it suggests.

    Was there a particular item in the page you wanted to draw my attention to?

  4. Tara
    Volunteer Moderator
    Posted 1 year ago #

    Was there a particular item in the page you wanted to draw my attention to?

    All instructions of that entire codex guide are important for properly moving a site.

    I've been through that page already and believe I've done everything it suggests

    ok

    - You may want to check the error logs on your server for a more specific error message. If you need help locating them, ask your hosting provider to help you with that.

  5. jedweb
    Member
    Posted 1 year ago #

    The only error I get in my error log is:
    [Sat Mar 22 07:11:59 2014] [error] [client xx.xx.xx.xx] File does not exist: /home/myuser/mydomain.com/news

  6. WPDeveloper
    Member
    Posted 1 year ago #

    Just a wild guess... try disabling Permalink and select the first option on Permalink Settings page (access posts, pages by id). Flush the cache and visit your website again; see if you're still facing the error. If no error, go to Permalink and select the format of your choice.

  7. Tara
    Volunteer Moderator
    Posted 1 year ago #

    Does that file exixt? If yes, does it exist at the right location?

  8. WPDeveloper
    Member
    Posted 1 year ago #

    @Tara, looking at the link jedweb has posted, it looks like link to Page.

  9. jedweb
    Member
    Posted 1 year ago #

    @WPDeveloper , you're correct!

    When I change to default permalinks mydomain.com/news/ works!

    However, changing back to my custom permalinks results in the 404 again.

    Interesting. So, any thought on what to do next? I don't have a cache plugin so I'm just flushing browser cache, right?

  10. Tara
    Volunteer Moderator
    Posted 1 year ago #

    If default setting works, then try reading Using_Permalinks before setting a custom permalink structure again.

  11. jedweb
    Member
    Posted 1 year ago #

    Thanks @Tara

    That page has been open in my browser for the past two days.

    I'll read it again; maybe I'm missing something.

    @WPDeveloper , any thoughts?

  12. Tara
    Volunteer Moderator
    Posted 1 year ago #

    - Also, if default setting works but not the pretty permalinks, make sure mod_rewrite is enabled on your server,

  13. jedweb
    Member
    Posted 1 year ago #

    Yes, mod_rewrite is enabled.

  14. Tara
    Volunteer Moderator
    Posted 1 year ago #

    if the issue still persists, it could be attributed to anything from a web server configuration to a bad WordPress install.

  15. jedweb
    Member
    Posted 1 year ago #

    If mod_rewrite wasn't enabled, the posts at /news/post_name wouldn't work either but all posts work.

    It's just the main blog page that doesn't work.

  16. jedweb
    Member
    Posted 1 year ago #

    My statement about mod-rewrite is correct, right?

    Those other pages wouldn't work if it was off.

  17. Tara
    Volunteer Moderator
    Posted 1 year ago #

    My statement about mod-rewrite is correct, right?

    yes, make sense to me

  18. jedweb
    Member
    Posted 1 year ago #

    Still frustrated by this issue.

    I tried deleting .htaccess so WordPress would recreate it. No change.

    Also, since trying to fix this, for some reason on my Posts > Categories , there is now checkbox next to my 'Blog' category. All other categories have the checkbox so that you can perform Bulk Actions on them. Only 'Blog' is without a checkbox. Weird.

    Thoughts?

  19. jedweb
    Member
    Posted 1 year ago #

    @Tara You say I may have a bad WordPress install.

    Would exporting the site, clearing out the directory, and then re-importing the site resolve that?

  20. keesiemeijer
    moderator
    Posted 1 year ago #

    Just did a test on my testsite and I think this is default WordPress behavior when using '/news/' as a prefix to your permalink structure. What do you want to happen when users visit mydomain.com (without /news/)? Redirect to mydomain.com/news/ ?

  21. jedweb
    Member
    Posted 1 year ago #

    Hi @keesiemeijer

    Thanks for the response.

    I want mydomain.com to show my home page, which is a Page in my site. I do not want it to redirect. I want mydomain.com/news/ to be the main page of the blog, displaying my most recent blog posts.

    Right now mydomain.com/news/ results in a 404 while mydomain.com/news/any-post-name works fine. That just seems strange to me. Why would just mydomain.com/news/ not be found?

    This is killing my sites traffic as mydomain.com/news/ was one of my most visited pages.

    Thanks for sharing any ideas you may have.

  22. keesiemeijer
    moderator
    Posted 1 year ago #

    Try creating a static front page and a posts page (news):
    http://codex.wordpress.org/Creating_a_Static_Front_Page

  23. jedweb
    Member
    Posted 1 year ago #

    @keesiemeijer ... That's exactly what I was looking for. It worked like a charm.

    I had created the static front page correctly but I hadn't created a blank page called 'news' that I was to set my posts page to.

    Setting the "Posts page" on Settings > Reading Settings is the key.

    Thank you.

  24. keesiemeijer
    moderator
    Posted 1 year ago #

    You're welcome. I'm glad you've got it resolved :)

Topic Closed

This topic has been closed to new replies.

About this Topic