tags:

views:

28

answers:

2

Hi,

In my web application i want to redirect to login page, which is in the same folder[admin folder], when i type like "xxx.com/admin" it is redirect to login.aspx page which is in admin folder.

for this i place one index.html page and write meta tag code, even though it is not redirect to loginpage. it is going to index.aspx page. shall i have to remove this index.aspx page, i have default page also there in admin folder. can u help me.

+1  A: 

Add this to your Web.config:

<authentication mode="Forms" >
    <forms loginUrl="login.aspx" name=".ASPXFORMSAUTH" />
</authentication> 

This will redirect users to your loginUrl if they try to access a protected page when they are not authenticated.

You should probably read up on Forms Authentication in asp.net to get all of the dirty details.

Here is an explanation of how you can add additional default documents to IIS. Default documents are used to try and determine which page a user should be directed to when they don't specify a specific page (your xxx.com/admin example)

Abe Miessler
Mr Abe Miessler i want admin side, i have to interfaces one is user interface and second one is admin interface when i want to go to admin login i have to type xxx.com/admin/adminlogin.aspx but i want when i type xxx.com/admin it redirect to xxx.com/admin/adminlogin.aspx this is my problem
Surya sasidhar
In IIS add `adminlogin.aspx` using the method described in the link provided in the last paragraph of my response.
Abe Miessler
My application is in online how can i change, how can i go to IIS in online
Surya sasidhar
@Surya, go to IIS on your web server.
Abe Miessler
+1  A: 

If you are using IIS 7.5 take a look at the UrlRewrite 2 Module http://www.iis.net/download/urlrewrite

If you are using IIS 6 you can use the asp.net 2 url rewriting technique, but the xxx.com/admin/default.aspx needs to be physically existing to allow redirects to happen

citronas