anm1001
asked on
301 redirect
I would like to setup a 301 redirect so that my home page index.aspx always defaults to the domain URL. So for example, I would like for www.mysite.com/index.aspx to redirect automatically to www.mysite.com.
Can someone please help me with this?
Can someone please help me with this?
ASKER
When I tried this, it seems to go into an endless loop without displaying the page. Is there another way?
In your index.aspx, try this.
<%@ Page Language="C#" %>
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","/");
}
</script>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://knowledge.freshpromo.ca/seo-tools/301-redirect.php#iis