views:

24

answers:

2

I have two urls that are supposed to lead to the same actual folder.

I can't do a redirect because the websites are built so they question the URL and perform accordingly.

So I built two application in the IIS (I tried using a virtual directory for one of them, but I kept crashing on the web.config can not be read). Everything works perfectly except the Application variables which are different between the two addresses. (Specificly I'm counting the number of current users logged on).

I tried to switch from InProc Session management to SQL, but that didn't solve the problem.

Maybe the solution is somewhere in the IIS so I'll have a proper redirection without using another application? Any ideas how to do that?

+2  A: 

The SQL session manager would do the trick but you need to configure it specifically so that it thinks they are the same application. Is this user specific variable, or global application variable?

K-Will
Global application var
Faruz
A: 

Since you basically have one app, but want two url's I would try to map them to the same app.

If it's two different host names you can use host headers in IIS to have them both go to the same web application.

If you want two different paths to go to the same application you should look into using the IIS Rewrite Module. Set up an application on one url, and create a rewrite rule to map the other url to the first one.

There's a lot of information on learn.iis.net about the URL Rewrite Module.

Mikael Svenson
I fought with the URL rewrite. It created a problem since I couldn't use the Request.URL anymore to find out what was the original URL entered.
Faruz
What about HttpRequest.RawUrl? Will that help?
Mikael Svenson