简体   繁体   中英

403 Error - Wordpress link not working when permalink setting is set to 'post name'

I'm migrating my first Wordpress site to a live server. Eventually the site will have it's own domain name, but for testing purposes I have uploaded it as a folder within my own personal site.

http://connorhome.com/moorfield/

All the pages work except the 'restaurant' page, which throws up a 403 error. The page is fine locally. It is worth noting that this page uses a different template to the other pages.

If I change the permalink structure to 'default', the page loads fine. Does anyone have any ideas of how to fix this? I have read that 'post name' isn't a great way of structure permalinks, but for the sake of this site (which only has a few pages) it is ideal, so I'd like to get it working if possible. Thanks.

This is what my .htaccess file is showing:

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

# END WordPress

您必须与子弹“餐厅”有冲突,请检查您是否有具有相同子弹的帖子或自定义帖子类型项目。此外,尝试重新保存永久链接以刷新重写规则。.我通常有这些我将自定义帖子类型重写为与现有页面相同的标签时出现问题

Sorry that I cant comment yet since I would have done instead of answering. But I am wondering if 'Restaurant' is a custom taxonomy.

Also, check your trashed pages and posts to see if any pages are there with the same permalink as /restaurant - and if so delete them.

Instead of using the rewrite rule, create an actual subdomain via your hosts admin tools. Then, regenerate the .htaccess file. So it will be: moorfield.connorhome.com

尝试使用此插件刷新您的重写规则

make sure rewrite mode enable in your server first check in your server rewrite mode is enabled or not because this errors come only when the rewrite mode not enabled. and in localhost you can enable and apache2 extension rewrite then check it is working on not.

Maybe you should reset the permission of your 'restaurant' directory. More detailed info here: http://en.wikipedia.org/wiki/HTTP_403

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM