I have two MVC websites:
www.website1.com/Mobile
www.website2.com
I need to create a URL www.website2.com/mobile that points to www.website1.com/Mobile without any redirect, I have to stay in the URL www.website2.com/Mobile and open the content of www.website1.com/Mobile Controller/View.
There are at least a few ways to do this:
iFrame. You could make a page under www.website2.com/mobile
that points to www.website1.com/Mobile
but the address bar would remain the same. W3 Schools has some basics where I've also used this as a way to generate a page within a page concept.
Reverse Proxy. Nginx could be used to make the site under www.website2.com/Mobile
go to www.website1.com/Mobile
as one software package that could be used. Nginx documentation would have more specific details though I have used this at times in the past.
From the second link as an example:
location /some/path/ {
proxy_pass http://www.example.com/link/;
}
In your case, you'd likely want to do something like this:
location /Mobile {
proxy_pass http://www.website1.com/Mobile/;
}
Course one does have to ensure that Nginx is configured properly as it is kind replacing your initial web server here. The idea would be that Nginx does the redirecting and stuff behind the scenes through its proxying stuff that the user never notices.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With