+ -
当前位置:首页 → 问答吧 → RewriteRule与RedirectMatch有什么区别

RewriteRule与RedirectMatch有什么区别

时间:2011-03-27

来源:互联网

我在.htaccess文件中写如下:

RewriteRule ^/$ /error/showerror.html [R]

RedirectMatch ^/$ /error/showerror.html

为什么RedirectMatch 有效,可以跳到指定页面;而RewriteRule 没起到作用,也就是没匹配到,为什么?

作者: alilanger   发布时间: 2011-03-27

最好将的重写内容全发出来。

你可以尝试这样写,加上L标记,阻止后面重写
RewriteRule ^/$ /error/showerror.html [R,L]

作者: hnxxwyq   发布时间: 2011-03-27