【发布时间】:2011-03-30 15:55:34
【问题描述】:
我正在尝试让 Wordpress 在目录 (/blog) 中启动并运行,但由于根目录中有一个 .htaccess 文件,我认为当我打开永久链接时它会发生冲突。当我尝试访问诸如 http://www.domain.com/blog/2011/03/article-name/ 之类的页面时,我得到了 404。但是,我可以访问 http://www.domain.com/blog/
这是根目录中的 .htaccess:
RewriteEngine On
RewriteBase /
#If not valid file send request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
这是 /blog 目录中的 .htaccess:
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
有什么办法可以修复 wordpress 永久链接吗?我可以访问这两个 .htaccess 文件(如果解决方案需要编辑根目录中的那个)..
【问题讨论】:
-
最后一条规则很奇怪。我会设置
^.*$。关于冲突,mydomain.com/blog/blablabla返回什么?/的索引 ??
标签: wordpress mod-rewrite