redirect using htaccess, if a url contains query string
10,144
Try in you .htaccess, placing this above your wordpress rules (just under RewriteEngine On
:
RewriteCond %{QUERY_STRING} ^pageid=7$
RewriteRule ^modules/pages/$ http://www.xxx.com/aaa/ [R=301,L]
Mod_alias's Redirect
won't match against query strings.
Related videos on Youtube
Author by
user930026
Updated on September 18, 2022Comments
-
user930026 over 1 year
I want to do permanent redirect using htaccess. For eg :- I want to redirect
/modules/pages/?pageid=7
tohttp://www.xxx.com/aaa/
.This is what i have done
Redirect permanent /modules/pages/?pageid=7 http://www.xxx.com/aaa/
but it gives me 404 error.-
Admin over 12 years
-