【发布时间】:2011-03-26 04:03:39
【问题描述】:
您好,我正在尝试编写一个 mod_rewrite 规则来重定向除根文件夹之外的所有内容。 例如,www.example.com 应该加载 index.html 文件 对于其他一切,例如www.example.com/tag,/tag 应该传递给子目录中的脚本
我现在有
RewriteCond %{REQUEST_URI} !^/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) app/webroot/$1 [L]
这可以很好地加载 index.html,但 /tag 没有传递给 webroot。我收到 404 错误。
谢谢
【问题讨论】:
-
如果将重写规则更改为 RewriteRule (.*) http://yourdomain.com/app/webroot/$1 [L,R] 重定向到的 URL 是什么?跨度>
标签: apache .htaccess mod-rewrite