Issue
Below rewrite configuration only redirects url of the form
/fetchHomePage.action?site=eu
RewriteCond %{QUERY_STRING} ^site=(eu|jp|in)$ [NC]
RewriteRule ^/?fetchHomePage.action$ https://example.com/%1? [R=301,L,NC]
What should I change in the regex above so that it can even redirect url like
/fetchHomePage.action;jsessionid=60E508BF73717B6BE0C38D80769A0A22?site=eu
Leads here are appreciated?
Solution
There is no problem to match a ; in the url-path.
url-path with ";" is not matched as a query string you match it with the RewriteRule as you do with anything else.
So to match the jsessionid you just append it to the matched url-path as:
RewriteCond %{QUERY_STRING} ^site=(eu|jp|in)$ [NC]
RewriteRule ^/?fetchHomePage.action;jsessionid=60E508BF73717B6BE0C38D80769A0A22 https://example.com/%1? [R=301,L,NC]
There is no need to escape it. As for the string itself of the jsession id, you can match it however you want, like (.*)?, there may be more fitting and more specfic ways to match it but that's up to your preferences.
Answered By - ezra-s Answer Checked By - Willingham (WPSolving Volunteer)