Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > file renamed after server upgrade

Reply
Thread Tools

file renamed after server upgrade

 
 
c676228
Guest
Posts: n/a
 
      01-25-2008
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
 
 
 
 
c676228
Guest
Posts: n/a
 
      01-25-2008
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
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      01-26-2008
Gazing into my crystal ball I observed =?Utf-8?B?YzY3NjIyOA==?=
<(E-Mail Removed)> writing in
news:(E-Mail Removed):

> 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
 
Evertjan.
Guest
Posts: n/a
 
      01-26-2008
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
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      01-28-2008
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==?= <(E-Mail Removed)>
>References: <(E-Mail Removed)>
>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
 
Daniel Crichton
Guest
Posts: n/a
 
      01-28-2008
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
 
Evertjan.
Guest
Posts: n/a
 
      01-28-2008
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
 
c676228
Guest
Posts: n/a
 
      01-28-2008
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
 
Anthony Jones
Guest
Posts: n/a
 
      01-29-2008
"c676228" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
 
Evertjan.
Guest
Posts: n/a
 
      01-29-2008
Anthony Jones wrote on 29 jan 2008 in
microsoft.public.inetserver.asp.general:

> "c676228" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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.


server.transfer works fine here.

Please, OP, temporarily test in your 404.asp page for the exact
querystring string by doing a nonexistant .html request before you start
coding the string manipulation:

Response.Write Request.ServerVariables("QUERY_STRING")
Response.end

>>
>> 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.


If this is true, and it probably is with response.redirect, then it is
just as requested, as indeed the object is moved.

But I am using server.transfer extensively, and here, as the fysical
..html page no longer exists, the 404.asp page is immediately invoked and
with my server.transfer the .html page mimiques the real asp page and
returnss a 200 status.

I even have about 300 virtual .asp pages in a nonexistent directory on a
server sharing one real asp page and invoked via this 404.asp code if
theatdirectory name is detected. The different page names are resolved in
the single page asp-vbs code to render the required html.


> 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.


I hate that word "better".

"Another" is fine:

> 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.


Many of us [see below] have no access to the IIS settings they use,
but if you have, it seems a nice move. "The best" comes to mind.


> BTW, have you considered the impact on your system where previously
> static and cachable html pages appear as dynamic content to the
> client.


I reckon most of our [this NG reader's] servers have less than a few
thousands visits a day, so the impact is unimportant for most of us.

> Your site will not benefit from browser and proxy caches
> anywhere as much as it was.


Not in the case of server.transfer, as to the outside cyberworld the
virtual page is just a page.

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

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error "Unable to read the project file .. The project file ' ' has been renamed or is no longer in the solution Amarpal ASP General 2 12-31-2011 02:44 AM
ifstream: reopening a file after it was renamed/deleted ultr C++ 2 03-09-2008 09:31 PM
Input fields are renamed with runat="server", how do I change it jamessmb ASP .Net Web Controls 3 01-17-2006 08:15 PM
program fails after they renamed the server computer!!! Trint Smith ASP .Net 2 08-25-2003 03:59 AM
Can a .aspx file be renamed to .htm? Bruce W...1 ASP .Net 11 08-23-2003 11:04 PM



Advertisments