0
votes

I've also put this post on the WP Stackexchange but figured a htaccess/rewrites genius may be able to fix it here as well as there.

My WordPress site is returning a 404 not found error on any page apart from the homepage and /wp-admin. I have no absolutely no idea why this is. My Permalinks are set up to use /year/month/date/post-title/ (e.g www.domain.com/2014/04/28/sample-post/). When I change the permalinks to the default (?p=123) it works fine, but not on any of the other ones. Here is the contents of the .htaccess file:

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

I have also installed the plugin 'Debug This', which provides details on the Rewrite Rules. However because it's a pretty big list and unformatted it would look quite bad, I've put it in a jsfiddle, here: http://jsfiddle.net/k8PHD/embedded/result/

I think that's all the details I have, I've disabled all plugins and stuff like that. Thanks for any help.

3
I don't think you need this line... RewriteRule ^index\.php$ - [L] but I could be wrong, wordpress.org/support/topic/…. Also this guide is what I have had to do in the past, codex.wordpress.org/Using_Permalinks#Fixing_Permalink_ProblemsGrady D

3 Answers

0
votes

Your .htaccess looks right to me. Might be the simple case of resetting your permalinks to default and then back to postname.

0
votes

I was having similar problem with permalinks not working, all i had to do was got Setting>>Permalinks and click save changes. It worked. This link can be helpful http://www.wpbeginner.com/wp-tutorials/how-to-fix-wordpress-posts-returning-404-error/

0
votes

Its a very common problem that we face once in a time while working on word press so don't panic ,usually it happens if your .htaccess file got deleted or something went wrong with the rewrite rules. What you need to do is just fix your permalinks settings. just go to Settings ->Permalink and click on save changes button this will flush out all rewrite rules and your website works fine.