使用htaccess如何301重定向以下内容?
hot
至domain.com/index.php?r=apiv2/*
app.domain.com/index.php?r=apiv2/*
是任何事物的通配符
这是我到目前为止的尝试:
*
提前致谢!
答案 0 :(得分:0)
您可以使用:
RewriteCond %{QUERY_STRING} r=apiv2(.*)
RewriteRule ^index\.php$ https://app.domain.com/index.php?r=apiv2%1 [L,R=301]
%1反向引用最后匹配的RewriteCond模式