How can i redirect the request in dispatcher with query parameters from one page to another page without losing query parameters, for example, redirect should take place from
https://www.mysite.com/content/us/en/firstpage.htm?a=xyz
to
https://www.mysite.com/content/us/en/secondpage.htm?a=xyz
Appreciated any inputs and pointers.
Solved! Go to Solution.
Views
Replies
Total Likes
Hello,
I never had this use case, but looking at the Apache docs, I think you need to use the QSA flag. Something like this:
RewriteRule ^my-url/([A-Za-z0-9-_]+)/?$ recirect-url&app=$1 [L,QSA]
Link to Apache docs: https://httpd.apache.org/docs/2.2/en/rewrite/flags.html#flag_qsa
Hope it helps,
Daniel
Hello,
I never had this use case, but looking at the Apache docs, I think you need to use the QSA flag. Something like this:
RewriteRule ^my-url/([A-Za-z0-9-_]+)/?$ recirect-url&app=$1 [L,QSA]
Link to Apache docs: https://httpd.apache.org/docs/2.2/en/rewrite/flags.html#flag_qsa
Hope it helps,
Daniel
@imalakaamir Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you!
Views
Replies
Total Likes
@imalakaamir consider to use the below with regular express
- mod_rewrite : for URL rewrite and RewriteCond to capture/rewrite URL-with param
Views
Likes
Replies