开发者

.htaccess rule not catching

开发者 https://www.devze.com 2023-02-10 02:48 出处:网络
I\'m trying to catch http://mysite.loc/orders/invoice/?id=asdf and redirect it, but it\'s not catching.Does anyone have any ideas on something I might\'ve missed?

I'm trying to catch http://mysite.loc/orders/invoice/?id=asdf and redirect it, but it's not catching. Does anyone have any ideas on something I might've missed?

Rewrit开发者_Python百科eEngine On

RewriteRule ^orders/invoice?id=([^/]+)$ /store/order/view?hash=$1 [R=301,L,NC]


Rewrite rules act on request URIs. The query string (the question mark and everything after it) is not part of the URI so you can't write a pattern to match it.

Try this:

RewriteEngine On
RewriteCond %{QUERY_STRING} id=(.*)
RewriteRule ^orders/invoice /store/order/view?hash=%1 [R=301,L]
0

精彩评论

暂无评论...
验证码 换一张
取 消