IIS ASP - redirection

This is Interesting: Free IT Magazines  
Home > Archive > IIS ASP > April 2006 > redirection





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author redirection
Hugh Welford

2006-04-27, 7:52 am

Hi - I have an obsolete site residing in a host domain sub-directory, many
pages of which are listed in google. Dont want to lose valuable google
listings.

Can anyone tell me how to re-direct .htm pages? If the whole site were
deleted, is it possible to customise the 404 page not found page so that it
re-directs to the new site?

Thanks

Hugh


Mike Brind

2006-04-27, 7:52 am


Hugh Welford wrote:
> Hi - I have an obsolete site residing in a host domain sub-directory, many
> pages of which are listed in google. Dont want to lose valuable google
> listings.
>
> Can anyone tell me how to re-direct .htm pages? If the whole site were
> deleted, is it possible to customise the 404 page not found page so that it
> re-directs to the new site?
>
> Thanks
>
> Hugh


<meta http-equiv="refresh" content="n(secs);
url=http://www.wherever.com/newfile" />

but you really should have asked this question in an html group.

--
Mike Brind

Mike Brind

2006-04-27, 7:52 am


Mike Brind wrote:
> Hugh Welford wrote:
>
> <meta http-equiv="refresh" content="n(secs);
> url=http://www.wherever.com/newfile" />
>
> but you really should have asked this question in an html group.
>


On the other hand, asking this question in an asp group isn't so wrong:

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

I nearly forgot all about that :-)

--
Mike Brind

Evertjan.

2006-04-27, 7:52 am

Mike Brind wrote on 26 apr 2006 in
microsoft.public.inetserver.asp.general:

> Hugh Welford wrote:
>
> <meta http-equiv="refresh" content="n(secs);
> url=http://www.wherever.com/newfile" />
>
> but you really should have asked this question in an html group.


... except when this old site is equiped with ASP and set to run ASP on
it's .html pages. Then you could set on each page:

<%
response.redirect "http://mynewsite.xyz" &_
request.servervariables("SCRIPT_NAME")
%>

=============

... or: when this old site is equiped with ASP and and has a dedicated
404.asp page, that is code accessable to you, and could be set to detect
the actual failed page request and redirect accordingly.

=============

However, I then would recomment making a noindex, follow construction for
updating the bots.


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Evertjan.

2006-04-27, 7:52 am

Mike Brind wrote on 26 apr 2006 in microsoft.public.inetserver.asp.general:

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


That is even better!

and it could be implemented on a dedicated 404.asp, I suppose.

Does Response.AddHeader "Location",.. do an immediate redirect,
or after a Response.end?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mike Brind

2006-04-27, 7:52 am


Evertjan. wrote:
> Mike Brind wrote on 26 apr 2006 in microsoft.public.inetserver.asp.general:
>
>
> That is even better!
>
> and it could be implemented on a dedicated 404.asp, I suppose.
>
> Does Response.AddHeader "Location",.. do an immediate redirect,
> or after a Response.end?
>


After Response.End. On an asp page that has a load of calls to
databases, it would be worth popping Response.End just after
Response.Addheader "Location",... to save the rest of the page being
processed. Since the OP has plain html in his files, it's not so
necessary, but as you point out, he would have to set his server up to
run .htm files as asp.

I don't think he would need a 404 page. After a few months, the search
engines that index the old site should all have updated their indexes,
so deleting the old site without repercussions should be ok.

--
Mike Brind

Hugh Welford

2006-04-27, 7:52 am

Thanks very much guys - very helpful


"Hugh Welford" <hugh.welford@btinternet.com> wrote in message
news:%23cprhULaGHA.3832@TK2MSFTNGP04.phx.gbl...
> Hi - I have an obsolete site residing in a host domain sub-directory, many
> pages of which are listed in google. Dont want to lose valuable google
> listings.
>
> Can anyone tell me how to re-direct .htm pages? If the whole site were
> deleted, is it possible to customise the 404 page not found page so that
> it re-directs to the new site?
>
> Thanks
>
> Hugh
>



Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com