小编sho*_*sho的帖子

除了root之外的所有内容的Apache mod_rewrite

您好我正在尝试编写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]
Run Code Online (Sandbox Code Playgroud)

并且这会加载index.html,但/ tag不会传递给webroot.我收到404错误.

谢谢

apache .htaccess mod-rewrite

6
推荐指数
1
解决办法
3466
查看次数

标签 统计

.htaccess ×1

apache ×1

mod-rewrite ×1