Home page returns 404
Question
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]
</IfModule>
# 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?
Solution 2
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.
OTHER TIPS
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