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]
答案 0 :(得分:0)
您只需在根目录中使用此单一重定向规则.htaccess:
RewriteEngine On
## 301 Redirect
RewriteCond %{QUERY_STRING} (^|&)id=\d+ [NC]
RewriteRule ^Paper/printArticle\.asp$ /redirect-url-301.php? [R=301,NE,NC,L]