I’m looking for some help. I wanted to redirect the following paramters to another url, how can I make this possible? I have googled alot of other solutions but I fail to make this one work.
https://(www).website.com/reservation#!/confirm?code=a1XapXsCmlaC0
to
https://new-website.com/test/page#!/confirm?code=a1XapXsCmlaC0
Attempted code:
RewriteRule /reservation#!/confirm?code=$ https://test.com/$1
"grep"-ing the code value would make it much easier.
Any help is much appreciated.
Thanks in advance
2
Answers
You may use this redirect rule in your site root .htaccess:
Query string and fragment i.e. part after
#
will automatically be forwarded to the new URL.Based on your shown samples, could you please try following. Where you want to redirect from
(www).website.com
tonew-website.com
in url.Please make sure you clear your browser cache before testing your URLs.