Forum Moderators: phranque

Message Too Old, No Replies

mod_rewrite (what else)

mod_rewrite AND condition

         

TheRaven

12:39 pm on Jan 4, 2005 (gmt 0)



How would I write 2 conditions that will redirect/rewrite 1 host to another host and carry the QUERY_STRING with it? In other words (pseudo code)

If %{HTTP_HOST} ^mysite.com/page1.html
Redirect to www.mysite.com/page1.html

Not all requests will have a query string, but if it does, redirect host and query string, otherwise just redirect host.

Thanks!

jdMorgan

1:21 pm on Jan 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



TheRaven,

Welcome to WebmasterWorld!

By default, mod_rewrite will forward the query string, so any variation of the domain redirection code you've seen here in this forum should work.

Jim