Rewrite to a new domain? with url query? not working. :(help

New to mod_rewrite? This is a good place to start.

Rewrite to a new domain? with url query? not working. :(help

Postby louiemiranda » Thu Aug 27, 2009 5:04 pm

I have this rewrite rule...

Redirect all initial request from world.example.com to web.example.com

RewriteCond %{HTTP_HOST} ^world\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{SERVER_PORT} !^80$
RewriteRule ^(.*)$ https://web.example.com$1 [R=301,L]


Which works great. But, some of my applications has...

https://world.example.com/approvals/?id=b47b5256567

Unfortunately, it is not being redirected properly to web.example.com. Instead, it just goes to web.example.com without the query params.

How could I make all request redirect properly to web.example.com along with the query params?

Help
louiemiranda
 
Posts: 1
Joined: Thu Aug 27, 2009 4:58 pm

Postby richardk » Sat Aug 29, 2009 2:34 pm

Do you have any other mod_rewrite?

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^world\.example\.com$ [NC]
RewriteCond %{SERVER_PORT} ^433$
RewriteRule .* https://web.example.com%{REQUEST_URI} [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 26 guests

cron