I have been stuck with this issue for a while and getting desperate for some helps.
I am currently building a website with NodeJS and I am using AWS EC2 with Pound for routing configuration. For one part of the website, I want to redirect the visitor to an external website (e.g.: google.com) by using node res.redirect("http:// google.com"). However, this keeps getting redirected back to my homepage.
My understanding, it goes like this:
- Visitor goes to a my certain url (http:// home.com/test)
- In my NODE route, I use GET for 'test' and use res.redirect("http:// google.com").
- The server routes back to my homepage (http:// home.com)
If I try to use res.redirect('http:// google.com/something'), it will get redirected to http:// home.com/something.
This redirection works just fine in localhost (e.g. the user is able to reach the external URL), which means that this has something to do with my AWS EC2 or POUND configuration.
Has someone experienced this before and has a solution? Thank you very much!
Note: The space between 'http://' and the URL in this question is intended so they don't become a Link here. The space does not exist in my implementation.