2

Currently I have an internal server serv that has an application app.

It is running MVC 5 and has 2 pages Account/Logon which maps to controller and an action.

And Orders/Display (again controller/action)

In order for internet users in the outside world to see I have a host server host running IIS. It maps host URLs to the internal app like so

host/Account/Logon -->serv/app/Account/Logon

So basically anything after host/... gets changed to serv/app/....

My problem is if I do RedirectToAction("Display","Orders"); (there are lots of these redirects because there's lots of controller/action combos.

The internal server grabs the host portion but also tacks on "app" in order to switch to the next page or route

So,host/app/Orders/Display My problem is that the host IIS maps this URL to host/app/app/Orders/Display because that what it's mapping is set to do. always add "app"

How can I solve this issue? Is there any way for serv do a relative mapping? In order words it only sees the original host/Account/Logon so on switch it would be host/Orders/Display?

1 Answer 1

1

Use Redirect() instead of RedirectToAction() and pass in the url.

Sign up to request clarification or add additional context in comments.

2 Comments

I was hoping for an ASP ServerVariable that I could change so that AppDomainAppVirtualPath does not get put into path
Html.BeginForm also had the same problem. In that case I probably had to code HTML directly with custom URL path. What we eventually did is create a new website put the application under that with port 81 binding and change the mapping to go port 81 and the top of IIS. That way "app" would only show once in the path.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.