I have authentication in the web.config
<location path="Default.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880">
<credentials passwordFormat="Clear">
<user name="it" password="krypassword" />
</credentials>
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
everything works fine when running on local computer
but after publishing the webform my default.aspx must the first to load when visiting the site. but it just starts in the log in page
note: the default.aspx can be visit by all the visitors
and the users must log in for rest of the pages.
i do have the code for default document in the web.config
<system.webServer>
<defaultDocument enabled="true">
<files>
<clear />
<add value="Default.aspx"/>
</files>
</defaultDocument>
</system.webServer>
i already did this one from the other forum
http://stackoverflow.com/questions/3824951/forms-authentication-ignoring-default-document[
^]
1: adding this code in web.config
<system.webServer>
<handlers>
<remove name="ExtensionlessUrl-Integrated-4.0"/>
<remove name=" ExtensionlessUrl-ISAPI-4.0_32bit "/>
</handlers>
</system.webServer>
2. or this one in the login.aspx
protected void Page_Load(object sender, EventArgs e)
{
if (!(IsPostBack || IsAsync))
{
string returnUrl = Request.QueryString["ReturnUrl"];
if (returnUrl != null)
if (returnUrl == "/")
Response.Redirect("default.aspx");
}
}
but not of them works