I have a URL which ends
/presentation/Item?k=ZW52aXJvbm1lbnRhbC1oZWFsdGgtc2FmZXR5LXNlY3VyaXR5LWVuZ2xpc2g=&
Which I need to redirect to http://domain.co.uk/films/ehss/
But when I use the following; it doesn’t work; I’ve tried escaping special characters like the ? by adding a before it but still no joy.
If its of any use this is all being added to the very beginning of htaccess file on a wordpress site.
This is what I’ve been trying:
Redirect 301 /presentation/Item?k=ZW52aXJvbm1lbnRhbC1oZWFsdGgtc2FmZXR5LXNlY3VyaXR5LWVuZ2xpc2g=& http://domain.co.uk/films/ehss/
I’ve looked into see if any of the other characters are special characters and they aren’t. Also, I don’t think I can use REGEX for this either as I have about 50 urls all in the same format as above that need to be redirected to seo friendly urls.
2
Answers
You can parse
QUERY_STRING
usingmod_rewrite
You cannot match query string using
Redirect
directive. You can useTHE_REQUEST
variable to match both request uri and query string like this: