file renamed after server upgrade

This is a discussion on file renamed after server upgrade within the Inetserver forums in Microsoft Tools category; Hi all, Recently we are upgrading and merge our servers. We will move all *.html hosted on a unix system to our windows server. During the migration, we also upgrade almost all of our code, say almost all html pages have been renamed to *.asp in order to handle those pages dynamically. But the issue here is our original *.html pages are ranked very highly by search engine. We are not sure what kind of redirect will be benign to search engines. And it seems that there is no one-page auto redirects solution like you can do with unix system ...

Go Back   Application Development Forum > Microsoft Tools > Inetserver

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 01-25-2008, 05:34 PM
c676228
Guest
 
Default file renamed after server upgrade

Hi all,
Recently we are upgrading and merge our servers. We will move all *.html
hosted on a unix system to our windows server. During the migration, we also
upgrade almost all of our code, say almost all html pages have been renamed
to *.asp in order to handle those pages dynamically. But the issue here is
our original *.html pages are ranked very highly by search engine. We are not
sure what kind of redirect will be benign to search engines. And it seems
that there is no one-page auto redirects solution like you can do with unix
system (.htaccess file). On windows server, you have to redirect
individually. (man, think about if you have thousands of pages on a site.)
I searched a bit, the following code seems to do the job:
put this code on the top of every page I wish to be redirected:
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location", "http://www.example.com/yournewpage.asp"
%>

am I right? But I cannot do this way in the original *.html file since it is
not *.asp code. I have to use javascript to do dynamically redirect anyway.
but what kind of redirect will be beneficial to Search Engine, the
instantaneous meta refresh redirect or the old page with all the old content
removed and having a link towards the new page, which way is better, one
click or no click to get to the new page.
--
Betty
Reply With Quote
  #2  
Old 01-25-2008, 05:55 PM
c676228
Guest
 
Default RE: redirect search engine highly ranked page

Hi all,
sorry I have to change the original subject since it doesn't make any sense
--
Betty


"c676228" wrote:

> Hi all,
> Recently we are upgrading and merge our servers. We will move all *.html
> hosted on a unix system to our windows server. During the migration, we also
> upgrade almost all of our code, say almost all html pages have been renamed
> to *.asp in order to handle those pages dynamically. But the issue here is
> our original *.html pages are ranked very highly by search engine. We are not
> sure what kind of redirect will be benign to search engines. And it seems
> that there is no one-page auto redirects solution like you can do with unix
> system (.htaccess file). On windows server, you have to redirect
> individually. (man, think about if you have thousands of pages on a site.)
> I searched a bit, the following code seems to do the job:
> put this code on the top of every page I wish to be redirected:
> <%@ Language=VBScript %>
> <%
> Response.Status="301 Moved Permanently"
> Response.AddHeader "Location", "http://www.example.com/yournewpage.asp"
> %>
>
> am I right? But I cannot do this way in the original *.html file since it is
> not *.asp code. I have to use javascript to do dynamically redirect anyway.
> but what kind of redirect will be beneficial to Search Engine, the
> instantaneous meta refresh redirect or the old page with all the old content
> removed and having a link towards the new page, which way is better, one
> click or no click to get to the new page.
> --
> Betty

Reply With Quote
  #3  
Old 01-25-2008, 10:48 PM
Adrienne Boswell
Guest
 
Default Re: file renamed after server upgrade

Gazing into my crystal ball I observed =?Utf-8?B?YzY3NjIyOA==?=
<betty@newsgroup.nospam> writing in
news:2980B9D1-792F-47ED-9F5F-0ECF898DBB16@microsoft.com:

> Hi all,
> Recently we are upgrading and merge our servers. We will move all
> *.html hosted on a unix system to our windows server. During the
> migration, we also upgrade almost all of our code, say almost all html
> pages have been renamed to *.asp in order to handle those pages
> dynamically. But the issue here is our original *.html pages are
> ranked very highly by search engine. We are not sure what kind of
> redirect will be benign to search engines. And it seems that there is
> no one-page auto redirects solution like you can do with unix system
> (.htaccess file). On windows server, you have to redirect
> individually. (man, think about if you have thousands of pages on a
> site.) I searched a bit, the following code seems to do the job:
> put this code on the top of every page I wish to be redirected:
><%@ Language=VBScript %>
><%
> Response.Status="301 Moved Permanently"
> Response.AddHeader "Location",
> "http://www.example.com/yournewpage.asp" %>
>
> am I right? But I cannot do this way in the original *.html file since
> it is not *.asp code. I have to use javascript to do dynamically
> redirect anyway. but what kind of redirect will be beneficial to
> Search Engine, the instantaneous meta refresh redirect or the old
> page with all the old content removed and having a link towards the
> new page, which way is better, one click or no click to get to the
> new page.


IIRC there is something that you can do with custom error pages.

--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share

Reply With Quote
  #4  
Old 01-26-2008, 01:56 AM
Dave Anderson
Guest
 
Default Re: file renamed after server upgrade

"c676228" wrote:
> I searched a bit, the following code seems to do the job:
> put this code on the top of every page I wish to be redirected:
> <%@ Language=VBScript %>
> <%
> Response.Status="301 Moved Permanently"
> Response.AddHeader "Location", "http://www.example.com/yournewpage.asp"
> %>
>
> am I right? But I cannot do this way in the original *.html file
> since it is not *.asp code.


You can configure IIS to parse .html files the same as .asp. Alternatively,
you can construct a custom 404 handler. Either should be capable of
generating such a permanent redirect.



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Reply With Quote
  #5  
Old 01-26-2008, 07:49 AM
Evertjan.
Guest
 
Default Re: file renamed after server upgrade

Dave Anderson wrote on 26 jan 2008 in
microsoft.public.inetserver.asp.general:

> "c676228" wrote:
>> I searched a bit, the following code seems to do the job:
>> put this code on the top of every page I wish to be redirected:
>> <%@ Language=VBScript %>
>> <%
>> Response.Status="301 Moved Permanently"
>> Response.AddHeader "Location",
>> "http://www.example.com/yournewpage.asp" %>
>>
>> am I right? But I cannot do this way in the original *.html file
>> since it is not *.asp code.

>
> You can configure IIS to parse .html files the same as .asp.
> Alternatively, you can construct a custom 404 handler. Either should
> be capable of generating such a permanent redirect.


Since my servers are virtual and remote,
I use the latter option:

=========== 404.asp =============
<% ' vbs
qstr = Request.ServerVariables("QUERY_STRING")
if instr(lcase(qstr),".html")>0 then
on error resume next
x = replace(x,"404;http://www.example.com:80","")
x = replace(x,".html",".asp")
server.transfer x
on error goto 0
end if
%>
<body>
This is the 404 error page of www.example.com
</body>
==================================

Not tested, but roughly similar to my own proven 404.asp files

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
  #6  
Old 01-27-2008, 10:58 PM
Steven Cheng[MSFT]
Guest
 
Default RE: redirect search engine highly ranked page

Hi Betty,

If you want to keep those html files and let the html file do the
redirection, you can consider using the html meta tag to do the
redirection. Here is the example:

#Redirect to a Different URL using the Meta Tag "Refresh"
http://webmaster.iu.edu/tool_guide_i..._metatag.shtml

Also, If you have thousands of html pages that need to redirect to their
asp version ones, I think you may consider develop a custom ISAPI filter
component and plug in your IIS server which intercept those html page
requests and redirect to the ASP pages if necessary.

#Redirecting ISAPI Filter
http://www.15seconds.com/issue/961220.htm

#HOWTO: Redirect the browser to a new URL based on Referer
http://blogs.msdn.com/david.wang/arc...rect-the-brows
er-to-a-new-URL-based-on-Referer.aspx

Also, if you search "ISAPI filter" and "url rewrite", you will find many
existing commerical products that do such functions.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
>From: =?Utf-8?B?YzY3NjIyOA==?= <betty@newsgroup.nospam>
>References: <2980B9D1-792F-47ED-9F5F-0ECF898DBB16@microsoft.com>
>Subject: RE: redirect search engine highly ranked page
>Date: Fri, 25 Jan 2008 14:55:01 -0800


>
>Hi all,
>sorry I have to change the original subject since it doesn't make any sense
>--
>Betty
>
>
>"c676228" wrote:
>
>> Hi all,
>> Recently we are upgrading and merge our servers. We will move all *.html
>> hosted on a unix system to our windows server. During the migration, we

also
>> upgrade almost all of our code, say almost all html pages have been

renamed
>> to *.asp in order to handle those pages dynamically. But the issue here

is
>> our original *.html pages are ranked very highly by search engine. We

are not
>> sure what kind of redirect will be benign to search engines. And it

seems
>> that there is no one-page auto redirects solution like you can do with

unix
>> system (.htaccess file). On windows server, you have to redirect
>> individually. (man, think about if you have thousands of pages on a

site.)
>> I searched a bit, the following code seems to do the job:
>> put this code on the top of every page I wish to be redirected:
>> <%@ Language=VBScript %>
>> <%
>> Response.Status="301 Moved Permanently"
>> Response.AddHeader "Location", "http://www.example.com/yournewpage.asp"
>> %>
>>
>> am I right? But I cannot do this way in the original *.html file since

it is
>> not *.asp code. I have to use javascript to do dynamically redirect

anyway.
>> but what kind of redirect will be beneficial to Search Engine, the
>> instantaneous meta refresh redirect or the old page with all the old

content
>> removed and having a link towards the new page, which way is better,

one
>> click or no click to get to the new page.
>> --
>> Betty

>


Reply With Quote
  #7  
Old 01-28-2008, 11:14 AM
Daniel Crichton
Guest
 
Default Re: file renamed after server upgrade

Evertjan. wrote on 26 Jan 2008 12:49:20 GMT:

> Dave Anderson wrote on 26 jan 2008 in
> microsoft.public.inetserver.asp.general:


>> "c676228" wrote:
>>> I searched a bit, the following code seems to do the job:
>>> put this code on the top of every page I wish to be redirected:
>>> <%@ Language=VBScript %>
>>> <%
>>> Response.Status="301 Moved Permanently"
>>> Response.AddHeader "Location",
>>> "http://www.example.com/yournewpage.asp" %>


>>> am I right? But I cannot do this way in the original *.html file
>>> since it is not *.asp code.


>> You can configure IIS to parse .html files the same as .asp.
>> Alternatively, you can construct a custom 404 handler. Either should
>> be capable of generating such a permanent redirect.


> Since my servers are virtual and remote,
> I use the latter option:


> =========== 404.asp =============
> <% ' vbs qstr = Request.ServerVariables("QUERY_STRING")
> if instr(lcase(qstr),".html")>0 then
> on error resume next
> x = replace(x,"404;http://www.example.com:80","")


Shouldn't this be

x = replace(qstr,"404;http://www.example.com:80","")

> x = replace(x,".html",".asp")
> server.transfer x
> on error goto 0 end if %>
> <body>
> This is the 404 error page of www.example.com </body>
> ==================================


> Not tested, but roughly similar to my own proven 404.asp files


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



--
Dan


Reply With Quote
  #8  
Old 01-28-2008, 11:40 AM
Evertjan.
Guest
 
Default Re: file renamed after server upgrade

Daniel Crichton wrote on 28 jan 2008 in
microsoft.public.inetserver.asp.general:

> Evertjan. wrote on 26 Jan 2008 12:49:20 GMT:
>
>> Dave Anderson wrote on 26 jan 2008 in
>> microsoft.public.inetserver.asp.general:

>
> >> "c676228" wrote:
> >>> I searched a bit, the following code seems to do the job:
> >>> put this code on the top of every page I wish to be redirected:
> >>> <%@ Language=VBScript %>
> >>> <%
> >>> Response.Status="301 Moved Permanently"
> >>> Response.AddHeader "Location",
> >>> "http://www.example.com/yournewpage.asp" %>

>
> >>> am I right? But I cannot do this way in the original *.html file
> >>> since it is not *.asp code.

>
> >> You can configure IIS to parse .html files the same as .asp.
> >> Alternatively, you can construct a custom 404 handler. Either should
> >> be capable of generating such a permanent redirect.

>
>> Since my servers are virtual and remote,
>> I use the latter option:

>
>> =========== 404.asp =============
>> <% ' vbs qstr = Request.ServerVariables("QUERY_STRING")
>> if instr(lcase(qstr),".html")>0 then
>> on error resume next
>> x = replace(x,"404;http://www.example.com:80","")

>
> Shouldn't this be
>
> x = replace(qstr,"404;http://www.example.com:80","")


Indeed

>> x = replace(x,".html",".asp")
>> server.transfer x
>> on error goto 0 end if %>
>> <body>
>> This is the 404 error page of www.example.com </body>
>> ==================================

>
>> Not tested, but roughly similar to my own proven 404.asp files

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

>
>




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Reply With Quote
  #9  
Old 01-28-2008, 06:57 PM
c676228
Guest
 
Default Re: file renamed after server upgrade

Hi all,
Thanks for your input. I took Evertjan's suggestion and used the 404 page to
redirect all the *.html pages to *.asp page.
and just changed server.transfer to Response.Redirect x to make it work
correctly.
somehow, server.transfer just doesn't work.

thanks, thanks to Evertjan.

--
Betty


"Evertjan." wrote:

> Dave Anderson wrote on 26 jan 2008 in
> microsoft.public.inetserver.asp.general:
>
> > "c676228" wrote:
> >> I searched a bit, the following code seems to do the job:
> >> put this code on the top of every page I wish to be redirected:
> >> <%@ Language=VBScript %>
> >> <%
> >> Response.Status="301 Moved Permanently"
> >> Response.AddHeader "Location",
> >> "http://www.example.com/yournewpage.asp" %>
> >>
> >> am I right? But I cannot do this way in the original *.html file
> >> since it is not *.asp code.

> >
> > You can configure IIS to parse .html files the same as .asp.
> > Alternatively, you can construct a custom 404 handler. Either should
> > be capable of generating such a permanent redirect.

>
> Since my servers are virtual and remote,
> I use the latter option:
>
> =========== 404.asp =============
> <% ' vbs
> qstr = Request.ServerVariables("QUERY_STRING")
> if instr(lcase(qstr),".html")>0 then
> on error resume next
> x = replace(x,"404;http://www.example.com:80","")
> x = replace(x,".html",".asp")
> server.transfer x
> on error goto 0
> end if
> %>
> <body>
> This is the 404 error page of www.example.com
> </body>
> ==================================
>
> Not tested, but roughly similar to my own proven 404.asp files
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
>

Reply With Quote
  #10  
Old 01-29-2008, 04:39 AM
Anthony Jones
Guest
 
Default Re: file renamed after server upgrade

"c676228" <betty@newsgroup.nospam> wrote in message
news:F48CAD57-72BB-4270-BB99-17EB0F24DB43@microsoft.com...
> Hi all,
> Thanks for your input. I took Evertjan's suggestion and used the 404 page

to
> redirect all the *.html pages to *.asp page.
> and just changed server.transfer to Response.Redirect x to make it work
> correctly.
> somehow, server.transfer just doesn't work.
>
> thanks, thanks to Evertjan.
>



The problem you will have with a custom 404 page is that the request is
transfered to the 404 page via a 302 object moved response to the client.

Instead of server.transfer you might try sending your 301 response instead
of using a server.transfer in the 404 page. However I can't tell you
whether search engines are intelligent enough to apply the 301 response to
the original request URL.

A better solution would be to use an ISAPI filter to re-write the requested
URL.

Another solution would've have been to not have renamed the .html to .asp
and simply added .html to the list of file extensions handled as an ASP
script.

BTW, have you considered the impact on your system where previously static
and cachable html pages appear as dynamic content to the client. Your site
will not benefit from browser and proxy caches anywhere as much as it was.


--
Anthony Jones - MVP ASP/ASP.NET


Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 05:16 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.