I have tried to find a solution to my problem in the other asked questions on Stackoverflow, but though there a lot of such questions answered for the exact same question yet it is different because I am asking as to how I should define more than two query strings in the ReWrite Condition,
I am trying to do a 301 redirect on a query string URL:
to mask it as
,and have tried using the following code in htaccess:
RewriteRule ^http://abc.com/index.php?arg1=abc&arg2=abc$ /prettified_url [R=301,L,NC]
have also tried using:
RewriteCond %{HTTP_HOST} !^.*abc\.com
RewriteRule .? - [S=2]
RewriteCond %{REQUEST_URI} ^index.php
RewriteCond %{QUERY_STRING} ^arg1=abc [NC]
RewriteCond %{QUERY_STRING} arg2=abc [NC]
RewriteRule ^(.*)$ /prettified_url [R=301,L]
RewriteRule .? - [S=1]
RewriteRule - -
have also tried using the following code in the query string ReWrite Condition:
RewriteCond %{QUERY_STRING} ^arg1=abc&arg2=abc [NC]
Though, I am not able to see it being redirected to /prettified_url .
Try with below one :
RewriteCond %{QUERY_STRING} ^arg1=abc&arg2=abc
RewriteRule (.*) http://abc.com/prettified_url? [L,R=301]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.