admin管理员组文章数量:1418103
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/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: /
I think that's all the details I have, I've disabled all plugins and stuff like that. Thanks for any help.
EDIT: ok so I've since discovered a bit more info. I also forgot to say that the host for the site is Heroku (I'm building for a client and for some reason he's insisting I use Heroku, which is bad choice for WP I know but I can't persuade him otherwise so that's life). I recently installed heroku-buildpack-php-tyler
, which also installed Nginx. So I'm assuming that's whats broken my Permalinks. I then found this post, which seems to be about the issue I'm having, which links to this page on the Nginx Documentation. Problem is I've never used Nginx before so I don't know where to put all the code it's got in the first section entitled Abridged Basic Setup. Can someone help me out? Thank you :)
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/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/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.
EDIT: ok so I've since discovered a bit more info. I also forgot to say that the host for the site is Heroku (I'm building for a client and for some reason he's insisting I use Heroku, which is bad choice for WP I know but I can't persuade him otherwise so that's life). I recently installed heroku-buildpack-php-tyler
, which also installed Nginx. So I'm assuming that's whats broken my Permalinks. I then found this post, which seems to be about the issue I'm having, which links to this page on the Nginx Documentation. Problem is I've never used Nginx before so I don't know where to put all the code it's got in the first section entitled Abridged Basic Setup. Can someone help me out? Thank you :)
1 Answer
Reset to default 0- Your server does not have
mod_rewrite
enabled - Or you do not have
AllowOverride
set correctly to allow your.htaccess
file to operate correctly. You will needAllowOverride
set to at leastFileInfo
.
I'd bet on the latter, as mod_rewrite
is pretty ubiquitous.
Based on your edit, the issue is that Nginx doesn't use .htaccess
files. My experience with Nginx is limited but rewrite rules are written into server configuration files, I believe. The Codex has a page on the topic.
本文标签: htaccessWordPress site displaying 404 for any page apart from index
版权声明:本文标题:htaccess - WordPress site displaying 404 for any page apart from index 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745272159a2650957.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论