我正在训练使用htaccess将多像素参数从不同的asp页发送到单个php页面,但是代码没有将我重定向到php页面,有什么问题吗?
RewriteEngine On
## 301 Redirects
# 301 Redirect 1
RewriteCond %{QUERY_STRING} ^id=1$ [NC]
RewriteRule ^Paper/printArticle\.asp$ /redirect-url-301.php? [R=301,NE,NC,L]
# 301 Redirect 2
RewriteCond %{QUERY_STRING} ^idr=1&idrs=2&id=3$ [NC]
RewriteRule ^Paper/Article\.asp$ /redirect-url-301.php? [R=301,NE,NC,L]
# 301 Redirect 3
RewriteCond %{QUERY_STRING} ^idr=1&id=2$ [NC]
RewriteRule ^News/Article\.asp$ /redirect-url-301.php? [R=301,NE,NC,L]发布于 2014-11-04 12:42:48
您只需要在根.htaccess中使用这个单一的重定向规则:
RewriteEngine On
## 301 Redirect
RewriteCond %{QUERY_STRING} (^|&)id=\d+ [NC]
RewriteRule ^Paper/printArticle\.asp$ /redirect-url-301.php? [R=301,NE,NC,L]https://stackoverflow.com/questions/26732366
复制相似问题