Php 普通URL被重定向的301重写规则替换
我有一个名为local.maalumalu的虚拟主机。htaccess中有很多301重定向规则。我的问题是当我有这样的规则时 重定向301/special offers local.maalumalau/special-offers.html 然后 local.maalumalau/special-offers/free-child.html 被重定向到 local.maalumalau/special-offers.htmlfree-child.htmlPhp 普通URL被重定向的301重写规则替换,php,regex,apache,.htaccess,mod-rewrite,Php,Regex,Apache,.htaccess,Mod Rewrite,我有一个名为local.maalumalu的虚拟主机。htaccess中有很多301重定向规则。我的问题是当我有这样的规则时 重定向301/special offers local.maalumalau/special-offers.html 然后 local.maalumalau/special-offers/free-child.html 被重定向到 local.maalumalau/special-offers.htmlfree-child.html 即“找不到页面”。有什么建议吗 使用重
即“找不到页面”。有什么建议吗 使用
重定向匹配
而不是重定向
<代码>重定向匹配具有regex
支持:
RedirectMatch 301 ^/special-offers/?$ local.maalumaalu/special-offers.html
或者,如果要使用mod_rewrite,则:
RewriteEngine On
RewriteRule ^special-offers/?$ /local.maalumaalu/special-offers.html [L,R=301,NC]