![](/img/trans.png)
[英]Wordpress .htaccess preventing sub folder from rewriting its own urls
[英]rewriting urls in wordpress .htaccess
对于wordpress和服务器管理员来说,我是新手,我只是在本地目录的子文件夹中安装了一个wordpress博客。 但是我在配置.htaccess时遇到问题。 安装wordpress的文件夹称为onlifestyle,位于根目录中。 我的网址格式为: http : //onlifestyle.org/onlifestyle/health/basic-principles-of-proper-nutrition而不是http://onlifestyle.org/health/basic-principles-of-proper-nutrition我的根。 htaccess是:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?onlifestyle.org$
RewriteRule ^(/)?$ onlifestyle/$1 [NC,L]
wordpress .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /onlifestyle/index.php [L]
</IfModule>
#END WordPress
和我使用永久链接:
http://onlifestyle.org/onlifestyle/%category%/%postname%
我应该如何配置wordpress以便跳过URL中子目录的名称
除了.htaccess文件,您必须在Wordpress设置中设置正确的URL。 另请参阅: http : //codex.wordpress.org/Giving_WordPress_Its_Own_Directory
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.