After moving from subdirectory to home, home page does not display

I moved a wordpress directory from “http://example.net/wordpress” to “http://example.net” and now the home page is giving a 404 error.

Every other page is working correctly, AFAIK. For example, “http://example.net/about” displays correctly, but entering “http://example.net” into the address bar eventually resolves to “http://example.net/wordpress” and then gives a 404 error.

In the database, I changed the values for site URL and home URL to be correct.

The page that should be displayed is page_id=6. In the database table for “wp-options”, the option for “show_on_front” is set to “page”. The option for “page_on_front” is set to 6. (I didn’t change these values)

Typing in “http://example.net/?page_id=6” gives a 404 error but typing in “http://example.net/?page_id=416” goes to its correct page.

I set permalinks to “plain” (so no permalinks). In the reading options I set the home page to show blog posts (instead of a static page). When I do that, the site url with ?page_id=6 resolves correctly.

If I then change the reading options to use “Home Page” for the front page, When I do that, the site url with ?page_id=6 resolved to the correct page but the site address resolves to “example.net/wordpress” and shows the correct page.

I turn the permalinks on and the site url resolves to “example.net/wordpress” and gives a 404 error.

If I use a different static page for the home page, the same thing happens.

1 Answer
1

TL:DR: The slug of the home page and a folder at the root had the same name

There was a folder that I was using for home page assets, the address was “example.net/home/” and the original WP development was “example.net/wordpress/”. When I moved the wordpress files out to the root, the home page had a slug of “home” that now conflicted with that “example.net/home” folder. To fix this, in the Reading Options, I changed the home page to show posts. Then I changed the slug of the home page to “home-page”. Then I set the home page to show the static page “home-page” and now everything is working.

Leave a Comment