![](/img/trans.png)
[英]RewriteRule not working do not know how to test it the regex matches
[英]Why is my RewriteRule not working? Regex matches
网址应转到
from: http://myurl.com/anything/?_escaped_fragment_=/article/1234
to: http://myurl.com/rubriken/detail/articleuid/1234/
我的RewriteRule看起来像:
RewriteRule ^.*\?_escaped_fragment_=\/article/(.*)$ /rubriken/detail/articleuid/$1/ [R=301,L]
我在http://regex101.com/上测试了正则表达式,它与之匹配。 但是它在我的.htaccess中不起作用,在http://htaccess.madewithlove.be/上也不起作用。 我的错误在哪里?
因为RewriteRule中未使用?_escaped_fragment_=/article/1234
采用:
RewriteCond %{QUERY_STRING} _escaped_fragment_=/article/(.*)$
RewriteRule ^ /rubriken/detail/articleuid/%1/? [R=302,L]
测试工作正常时,将[R=301,L]
[R=302,L]
更改为。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.