vituxa
asked on
How do I make IIS respond with 301 instead of 404?
Hi Experts.
Is there a way I can make IIS respond with 301 instead of 404?
I have this domain name that used to be a very powerful website. No matter what link is clicked I need to 301 it to somewhere else.
I set up a default.aspx file that has this code in it:
but that only catches it for a main domain name. So if someone goes to www.thisnewdomainigot.com it works, but if someone goes to www.thisnewdomainigot.com/whateverlinkthisis.html it doesn't and still 404s.
I need to make Google think there isn't any 404s. How can I do that ?
Please help.
Is there a way I can make IIS respond with 301 instead of 404?
I have this domain name that used to be a very powerful website. No matter what link is clicked I need to 301 it to somewhere else.
I set up a default.aspx file that has this code in it:
protected void Page_Load(object sender, EventArgs e)
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location", "http://www.sitetoredirectto.com");
}
}
but that only catches it for a main domain name. So if someone goes to www.thisnewdomainigot.com it works, but if someone goes to www.thisnewdomainigot.com/whateverlinkthisis.html it doesn't and still 404s.
I need to make Google think there isn't any 404s. How can I do that ?
Please help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
but you did help me - Thank you.
ASKER
Open in new window