I have two MVC web applications, a www.company.com and a solution.company.com
The website www.company.com include links to solution.company.com/Contact but how can I set
The solutions proposed are good but a lot of overhead just to switch one url IMHO.
I would take the environment variable approach and set the url accordingly.
Contact.cshtml
@{
var env = Environment.GetEnvironmentVariable("MY_APP_ENV");
var url = env == "prod" ? "http://qa.solution.company.com/Contact/" :
env == "qa" ? "http://solution.company.com/Contact/" :
"http://localhost:88/contact/";
}
Contact Us
If this is a big project and you can invest some time, I would put this in appSettings
and set up parameters.xml for each environment and use it during deployment.