I’ve had a look through the many mod_rewrite examples, but I can’t find out how to rewrite the URL so that a query to one domain gets redirected to the new domain, and has a specific URL parameter added. I need to achieve the following:
a) change the server name
b) change the path to incude the application name
c) append URL parameter
eg:
example.com/index.html --> new_example.com/app/index.html?user=XX
example.com/page1.html --> new_example.com/app/page1.html?user=XX
example.com/page2.html --> new_example.com/app/page2.html?user=XX
example.com/page3.html --> new_example.com/app/page3.html?user=XX
Thanks in advance, Kevin.
It turns out you can use mod_rewrite to rewrite to a different domain, using the [P] redirect flag. As I understand it, this is equivalent to mod_proxy.
What I needed was this:
and the rewrite rule to achieve this is:
Thanks for the input.