Must have inadvertently changed something recently as when visiting the base URL (i.e. the homepage) for my local development site it returns a 404. All of the other pages seem to work fine.

As per other SE posts on the topics, have tested changing the permalinks settings and the .htacess file, from what I can tell, seems to be set appropriately.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dwp-wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dwp-wordpress/index.php [L]

# END WordPress

The front page is set to Home, but what's strange is when this is changed to Blog, the 404 is resolved and the front-page.php is pulled appropriately.

Does anyone have any idea as to what might be causing this issue?

  • check the code in your homepage, are there any misspelled includes? – inarilo Oct 11 '17 at 3:45
  • Could someone clarify why this question was downvoted? I have done my research and believe my question is clear. Thanks for your response @inarilo - the references in front-page.php seem to be fine; no php errors are logging and until recently the page was perfectly functional (having not touched that template file recently, I doubt that would be the cause). – Ryan Achten Oct 11 '17 at 5:58
  • did you try changing themes, disabling plugins, etc? – rudtek Oct 12 '17 at 16:59

Delete all changes you have done on the .htaccess

Make it clean and default to get it OK first, then do the customization.

Also try deactivating all plugins and changing your theme to a new one, better get one from https://wordpress.org/themes

  • Cheers for your response Jaed. Had already tried deactivating all the plugins and since the theme is a custom one I am building, selecting another one is not really an option. – Ryan Achten Oct 11 '17 at 19:46

After checking out previous commits, I eventually found the issue to be a custom query added to functions.php which had been inadvertently added to the home page. Strangely, this hadn't been logging any errors but still caused a 404.

By adjusting the scope of the query, the issue has now been resolved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.