【发布时间】:2012-02-05 21:03:53
【问题描述】:
我知道这可能已经得到解答,因为这似乎是一个常见问题,但我无法找到适合我的解决方案。
我在另一个站点的子目录中有一个 wordpress 站点。当我尝试调用 http://site.com/blog 时,我被重定向并出现 404 错误,但是当我调用 http://site.com/blog/ 时,页面按预期呈现。
不断出现的解决方案似乎是
# and does not end with a slash
RewriteCond %{REQUEST_URI} !/$
# then add a trailing slash and redirect
RewriteRule (.*) $1/ [R=301,L]
但每次我请求不带斜杠的页面时,我都会被重定向到http://site.com/app/webroot/blog
已安装博客的子文件夹位于 cakephp 应用程序的 webroot 中,我认为这可能与它有关?
【问题讨论】:
-
只需在 htaccess 中添加
RewriteBase /blog。 -
谢谢,我已经在 wordpress 安装根目录中有这个
标签: wordpress .htaccess cakephp http-status-code-404