IIS 6 URL Redirection

288 Views Asked by At

Is anyway to redirect the url "www.somesite.com" and when the browsers request as www.somesite.com/login.aspx.

Note:

www.somesite.com is built it on Asp.net MVC4 and hosted in IIS 6.0

www.somesite.com/login.aspx is developed using asp.net.

If someuser redirects our site using url www.somesite.com/login.aspx from bookmark. in that case how to direct to www.somesite.com.

I have already done using code from Global.asax but i dont want do that

Please help me

1

There are 1 best solutions below

0
On

URLs with an extension (i.e. *.aspx) bypass the MVC routing entirely, and are instead served by IIS directly. That's why adding stuff to Global.asax does nothing; Global.asax is never hit.

Instead, you will need to handle the rewrite at the IIS level, but IIS6 has no built-in support for rewriting URLs. There's a third-party plugin (third-party but free and open-source) to enable rewrite support. See: http://blogs.msdn.com/b/gaurav/archive/2013/11/12/urlrewrite-in-iis6.aspx.

Otherwise, I'd suggest deploying to a newer version of IIS. The version of Windows Server that deploys IIS6 should either already be end-of-lifed or well on it's way.