![](/img/trans.png)
[英]issue with URL redirection in Apache (mod_rewrite / mod_alias)
[英].htaccess mod_alias and mod_rewrite redirects are ignored
我想将所有请求重定向到我的index.php
脚本,这样在http://mysite/
之后的所有内容都将作为 url-ar 传递给index.php
For example, http://mysite/moo.css
should become http://mysite/index.php/moo.css
and http://moosite/moo/foo/bar/
should become http://index.php/moosite/moo/foo/bar/
.
容易吧?
但不是RedirectMatch (.*) index.php/$1
,也不是RewriteRule ^(.*)$ index.php/$1 [R,L]
(或其他类似的正则表达式;未省略RewriteEngine on
; mod_rewrite
和mod_alias
已打开) 生效。
这是怎么回事?
在不知道更多信息的情况下,我的猜测是该目录缺少Allowoverride
指令。 (队长风格回答明显,但还是容易被忽视)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.