Jump to content

  • Log in with Facebook Log in with Twitter Log In with Google      Sign In   
  • Create Account

Subscribe to HRA Now!

 



Are you a Google Analytics enthusiast?

Share and download Custom Google Analytics Reports, dashboards and advanced segments--for FREE! 

 



 

 www.CustomReportSharing.com 

From the folks who brought you High Rankings!



Photo
- - - - -

Another Redirection Issue


  • Please log in to reply
42 replies to this topic

#1 dpasc

dpasc

    HR 1

  • Members
  • Pip
  • 2 posts

Posted 25 May 2006 - 02:22 AM

I have a number of .htm pages that are indexed by the search engines. Those pages have been obsoleted and replaced by others with similar url name and content.

My purpose now is twofold:

1. Redirect the traffic through the old pages to my home page
2. Prevent search engines of assuming duplicate content

The problem is that I'm using extenal Windows hosting and the only access I have to the IIS is that of creating custom error pages. In addition, since the pages are .htm I cannot use vbscript for server redirection and any html refreh may be seen as spam by the search engines.

I thought of deleting the obsolete pages and create a custom 404 error page -let's say 404.asp- putting the following code in it:

Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.mydomain.com"

The question is: Will search engines associate the responded status with the requested page that has been removed?

If not (in case that they associate the 301 to the 404.asp itself) will they see 404 or 200 for the requested page? The 200 is what I really want to avoid here.

#2 lcesario

lcesario

    HR 1

  • Members
  • Pip
  • 3 posts

Posted 25 May 2006 - 08:51 AM

So glad to see your post about 301 redirects on IIS with .htm pages, as we're in the same boat.

Unfortunately, our host is no help...they won't allow ISAPI_rewrite or any server side solutions. Like you, the only thing we can modify is 400 level error pages. Everything I've read says "Meta Refresh" is treated as spam.

I've had someone suggest the possibility of a javascript solution at the top of each old page, or maybe a modification to the global.asa file. Does anyone know if this would work? If so, can you please give an example??

I'm desperately looking for the best way to handle this, as we have some GREAT rankings(thanks Jill!), that I don't want to lose with the restructuring of our website.

Many thanks!
Lcesario

#3 Jill

Jill

    Recovering SEO

  • Admin
  • 32,963 posts

Posted 25 May 2006 - 09:30 AM

Welcome lcesario! bye1.gif

#4 dpasc

dpasc

    HR 1

  • Members
  • Pip
  • 2 posts

Posted 25 May 2006 - 10:53 AM

Hi lcesario,

I have tried many things but didn't help. My host refered me to their forum but I couldn't fing anything helpful there.

Modification of global.asa works only if someone tries to access your home page. Any other page access attempt will ignore the global.asa.

A for Javascript, my information suggests that any client redirection is seen as spam.

I've used a "Check Server Headers Tool" to test my idea about a custom 404 page that returns a 301 and guess what...it works!

The page is redirected properly returning a 301 code.

Of course this works fine if you just want to redirect all old pages to your home or any other single page. If you want to redirect every old page to its replacement...

I can't really sort it out since the HTTP_REFERER returns the custom error page and not the page requested by the visitor.

#5 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 25 May 2006 - 04:59 PM

there are a few things you can do, longer post tomorrow when I'm awake biggrin.gif

#6 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 27 May 2006 - 06:43 PM

to get the requested URI from the 404 page use request.servervariables("QUERY_STRING") it is prepended with "404:" but a simple replace takes care of that.
Using this means you can do add a bit of code to redirect to the correct page and/or return a 404 as required.

lcesario, can you change the server mappings to parse htm pages as asp ? that is a useful solution for many issues.

#7 lcesario

lcesario

    HR 1

  • Members
  • Pip
  • 3 posts

Posted 31 May 2006 - 09:17 AM

Chrishirst,
Thank you for the idea....I felt a fresh wave of hope for a second regarding parsing as asp, until our host said "No" yet again. In fact, they suggested a Meta Refresh solution. I've been so happy with our host, Crystaltech, except for this issue. cry_smile.gif

I guess I'll have to explore dpasc's custom 404 asp page idea. I'm not sure I fully understand your comments regarding this in the last post though. Would what you're talking about work for redirecting several pages to the their new URI's?

Edited by lcesario, 31 May 2006 - 09:32 AM.


#8 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 31 May 2006 - 03:25 PM

did they give a reason for the No? or is it more a case of "we don't know how to" biggrin.gif

QUOTE
Would what you're talking about work for redirecting several pages to the their new URI's?
Yep it certainly will.
I use the 404 pages as part of coding "friendly URLs" for a couple of thousand pages on one site.

the actual means of this working depends on how many pages need redirecting. A few dozen could be done with an 2 dimensional array or a scripting dictionary holding all the page names and the new target. More than 60 or so would be better done with a database of entries.

If the pages are being redirected from page.htm to page.asp a simple replace() function will do, A more complex replace could be handled with a regular expression.

#9 lcesario

lcesario

    HR 1

  • Members
  • Pip
  • 3 posts

Posted 01 June 2006 - 11:09 AM

My host simply stated that "the issue has been reviewed and turned down by management on numerous occasions....."

Anyway, I'm wondering if you could please give me an example(or point me to a good source) for the VBscript(or Jscript?) that I would use to redirect the following:

"www.mydomain.com/oldpage.htm" to "www.mydomain.com/newdir/newpage.htm"

I haven't counted yet, but I'd bet there's around 50 pages that'll need to be redirected.

The other question that's come up is this: since we're going to be doing all of these redirects anyway....would it be a good idea to just change all of the static .htm pages on the site to dynamic(asp) pages? Do the search engines prefer or rank differently static vs. dynamic pages?

Thanks!

#10 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 01 June 2006 - 02:13 PM

QUOTE
My host simply stated that "the issue has been reviewed and turned down by management on numerous occasions....."
That's a "we don't care how useful it may be to our users" attitude then hmm.gif

Yes, use a .asp extension on your new pages. It will avoid issues like this for the future.
ALL pages are HTML to user agents. "Dynamic" pages to a SE are ones with a querystring in the URI


50 pages aren't a problem with an array

Original code deleted after some bug fixing
CODE
See post #18 for rectified code.

two possibles for this script, If you want to maintain the old URI and keep any rankings, linkpop etc for the page use the server.transfer line of code.
If you are not worried about the rankings glitch that will occur with the redirect use the response.status lines

Edited by chrishirst, 02 March 2007 - 06:39 AM.
removed buggy code


#11 Pacerfan

Pacerfan

    HR 1

  • Members
  • Pip
  • 5 posts

Posted 18 July 2006 - 07:15 AM

Hello:

You helped me a few weeks ago with a website conversion issue. I am in the process of converting a site from ASP to .Net and I need to redirect the ASP files to the .ASPX files. I am using the code you posted for the 404 error redirect file, but I keep getting the following error:

Microsoft VBScript runtime error '800a01b6'

Object doesn't support this property or method: 'request'

/error_redirect.asp, line 10

The error is occurring on this line:

request = replace(request.servervariables("QUERY_STRING"),"404;","")

Any ideas? Thanks a lot for your help. I really appreciate it!

#12 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 31 July 2006 - 03:03 AM

request is a "reserved word" in VbScript so should not be used as a variable name .


My fault for writing code at the keyboard, directly into the forum without testing it first ohno.gif

#13 Pacerfan

Pacerfan

    HR 1

  • Members
  • Pip
  • 5 posts

Posted 07 August 2006 - 02:05 PM

I have a follow-up question regarding the proposed server.transfer solution. Will the fact that the search engine spiders receive a 404 error before the server.transfer command redirects them to the new pages have a negative impact on my site? I am leaning toward using the server.transfer command and a database table (or xml file) that contains the two file names. However, I want to make sure the server.trannsfer solution is the best fit. Also, what is the advantage of using the server.transfer command over the 301 redirect (response.status = "301 Moved Permanently")

Thanks a lot for your help. I really appreciate it!

#14 chrishirst

chrishirst

    A not so moderate moderator.

  • Moderator
  • 6,938 posts
  • Location:Blackpool UK

Posted 09 August 2006 - 12:39 PM

server.transfer immediately transfers processing to another page, the only response a UA will get is a 200 (Ok). The URI does not change as no redirect occurs.

The UA will not get a 404 response because of the fact that a 404 page when set as a URL in IIS will always return a 200 response NOT a 404

#15 smc_online

smc_online

    HR 4

  • Active Members
  • PipPipPipPip
  • 279 posts
  • Location:Tampa, Florida

Posted 09 August 2006 - 12:59 PM

Hey chrishirst,

Just wanted to say a big "THANKS" for your thoughtful posts. Having much regard for techno-bable, I appreciate your responses. They are always useful.


Going off-topic:
Your skill set is one that I noticed that gets overlooked in search marketing venues. Perhaps you should propose to moderate a technology track at SES or Jills HR Seminars. ;o)

Its definitely a topic that gets overlooked!!




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

SPAM FREE FORUM!
 
If you are just registering to spam,
don't bother. You will be wasting your
time as your spam will never see the
light of day!