Forum Moderators: open

Message Too Old, No Replies

just need to redirect a few pages

i don't need a rule.. just a 1 to 1 example

         

nippi

1:44 am on Jun 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a client with an 8 page website, they have changed all their page names for some reason, with no real pattern.

I am thinking ot do a url1 to url2 rule for each old url, so inbound links to old urls still go somewhere.

I can't find how to do this - so much about how to do it in apache mod rewrite...

can anyone help?

Its on IIs / 6

marcel

4:52 am on Jun 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just put this code on the (old) page you want to redirect:

Classic ASP
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.example.com/newpage/"
%>


ASP .NET
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.example.com/newpage/");
}
</script>

nippi

9:03 am on Jun 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



problem.

they are .html pages

marcel

10:06 am on Jun 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do the old URLs also have the .html extension? or are they the default document within a directory?

ie. are the URLs example.com/category.html or example.com/category/

If the former you will need to configure IIS to handle the .html extension via the asp.dll or invest in ISAPI_Rewrite

If the latter, you can just put another default document in that folder (default.asp) and add the code.

IntegrityWebDev

4:29 pm on Jun 11, 2010 (gmt 0)

10+ Year Member



If the old files are HTML and the new are ASP can you use a META REFRESH in the old ones?

<meta http-equiv="refresh" content="0;url=http://www.example.com">