我有一个wp博客,它位于/var/www/mysite.com/blog,可通过www.mysite.com/blog访问
当访问www.mysite.com/blog/我看到索引页面,但子目录上的所有链接不再工作,例如:www.mysite.com/blog/my-great-article正在抛出(apache日志):
File does not exist: /var/www/mysite.com/web/blog/my-great-article, referer: http://www.mysite.com/blog/
虚拟主机:
Alias /blog "/var/www/mysite.com/web/blog" <Location "/blog"> Allow from all AddType application/x-httpd-php php php4 php3 html htm </Location>
.htacess in / blog dir:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /blog/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /blog/index.php [L] </IfModule> # END WordPress
我该如何解决这个问题?
我遇到了同样的问题,在我的情况下有什么帮助是添加RewriteBase的域别名根.htaccess
RewriteBase /blog
Withought结尾斜杠,也在RewriteRule引用index.php而不是/blog/index.php