Redirect not changing url in user browser
Hi,
I configured a redirect from https://www.host1.com/fastly_test to https://www.host2.com/blog
I created a response and a header following the steps mentioned in this post: https://docs.fastly.com/en/guides/generating-http-redirects-at-the-edge.
The problem is that it redirects correctly but it changes the URL in the user browser. I want to maintain the original URL in the user browser or, the other option, would are to change to https://www.host1.com/blog. The idea is the user doesn't see https://www.host2.com/.
It's possible?
Thanks in advice.
-
Hi Fernando,
If you are looking to keep the same host www.host1.com and URL in the browser, you can't use the 301/302 redirection because it triggers the client to send another HTTPS request. Instead, you could
1) set the www.host2.com as origin and
2) rewrite the URL from /fastly_test to /blog, so that the browser keeps the same URL but Fastly pulls the content from www.host2.com/blog.If you come across any issue, please feel free to send us a ticket with your service ID. Happy to help.
Best,
Hiro
-
I know it's been a while but I was wondering how exactly you can do #2? I've tried doing "set req.url '/some/path'" but it ends up showing '/some/path' in the user browser...
Would really appreciate any help!
-
Would really appreciate if you could provide answer to the second point. How can set the origin ?
Thanks!
-
Hello,
We'd be happy to assist. In order to address your specific use case, please send us a support ticket by emailing support@fastly.com. Please include your service ID.
Please sign in to leave a comment.
Comments
4 comments