Transfer to a new domain? with url request? doesn't work. :( Help
I have this rewrite rule ...
Redirect all initial requests 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 apps have ...
https://world.example.com/approvals/?id=b47b5256567
Unfortunately it does not redirect properly to web.example.com. Instead, it just goes to web.example.com with no query parameters.
How can I correctly redirect the request to web.example.com along with the request parameters?
Basically, what should he do ...
https://world.example.com/approvals/?id=b47b5256567
then
https://web.example.com/approvals/?id=b47b5256567
Just changing the world to the Internet and passing in the query string.
reference
+2
source to share
3 answers
We can do this with Nginx too.
server {
listen 80:
server_name: world.example.com
# URL redirect
#rewrite ^ http://web.example.com$request_uri? permanent;
rewrite ^ $scheme://web.example.com$request_uri permanent;
#rewrite ^ $scheme://web.example.com permanent;
#rewrite ^ $scheme://web.example.com;
}
Link:
0
source to share