Forum Moderators: open

Message Too Old, No Replies

How to implement 301 redirect on an IIS (ASP) site

301 redirect needed for an IIS-based site

         

websage

12:49 am on Feb 19, 2004 (gmt 0)

10+ Year Member



Hello, a new client has default.asp which redirect automatically to a shopping card-driven content area like this:

<% link="http://www.website.com/shop/mydefault.asp" %>
<% response.Redirect(link) %>

Is this SE-friendly way to redirect? If not, how does one implement an ASP version of 301 Redirect for the default page?

Thanks in advance,

Mitko / WebSage

skipfactor

12:52 am on Feb 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<%
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.newdomain.com/"
Response.End
%>

websage

12:59 am on Feb 19, 2004 (gmt 0)

10+ Year Member



Thanks! I take it, this is the way to do it for both classic ASP and ASP.NET?

irotte

7:36 pm on Mar 12, 2004 (gmt 0)

10+ Year Member



Is that a good idea to remove all lines in the old files and put only those 4 lines?

Xoc

1:47 am on Mar 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's worth putting some content on the page with a <a> tag referring to the new url, too. Some people have auto redirects turned off in their browser, and you want them to be able to get to the new page, too.