Is it possible to reroute a user based off of parameters sent to a Controller?

I'm pretty inexperienced when it comes to working with IIS, so I apologize if the question is a bit confusing.

In the application, I have a Controller with a method called 'Login' that takes in a string parameter. The parameter identifies the organization the user is trying to authenticate against.

For example:

http://mysite1.com/Login/12345

Visiting this link brings the user to a login page for the organization that is associated with '12345' for their access key.

Is there any way to redirect users that are logging in under '12345' to another server? We have a few beta users that are willing to participate, but the database schemas for both servers are different, so it's important that the beta users are not hitting the wrong site.

After the user logs in, the access key is no longer in the URL, so I can't do matches against it.

I'd like for the user to see the following URL:

http://mysite1.com/Login/12345
http://mysite1.com/Products/
http://mysite1.com/Admin/

While in reality they're on a different server:

http://mysite2.com/Products/
http://mysite2.com/Admin/

I have to emphasize that I really do need the URL to stay 'mysite1' for the user, when in reality they'll be on 'mysite2'. Please let me know if this is possible or not, or if there's a better solution for it.

Sorry if this is a confusing scenario or if there's some information that I'm missing. I'll make edits if necessary.

Answers


Virtually anything is possible, but this approach seems really painful.

IIS can perform URL rewriting but it's going to be doing this before it hits the authentication layer so it will not be possible to differentiate users at that level.

It seems like the best option will be to write a custom URL rewriter provider. Looks like this post is attempting to solve it that way.

It really seems better to either redirect to a different server (which I know you're saying you can't do) or merge the multiple versions of functionality into a single app (with different controls/backend models, etc.)

This link may help in understanding a little bit about how the flow works in an ASP.NET MVC app.


Need Your Help

(Physical)(Installed) path of DLL installed to the GAC

c# dll file gac

How can I get the (physical) installed path of a DLL that is (may be) registered in GAC? This DLL is a control that may be hosted in things other than a .Net app (including IDEs other than VS...).