Are you a Google Analytics enthusiast?
More SEO Content
Another Redirection Issue
Posted 25 May 2006 - 02:22 AM
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.
Posted 25 May 2006 - 08:51 AM
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'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.
Posted 25 May 2006 - 10:53 AM
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.
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.
Posted 25 May 2006 - 04:59 PM
Posted 27 May 2006 - 06:43 PM
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.
Posted 31 May 2006 - 09:17 AM
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.
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.
Posted 31 May 2006 - 03:25 PM
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.
Posted 01 June 2006 - 11:09 AM
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?
Posted 01 June 2006 - 02:13 PM
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
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
Posted 18 July 2006 - 07:15 AM
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!
Posted 31 July 2006 - 03:03 AM
My fault for writing code at the keyboard, directly into the forum without testing it first
Posted 07 August 2006 - 02:05 PM
Thanks a lot for your help. I really appreciate it!
Posted 09 August 2006 - 12:39 PM
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
Posted 09 August 2006 - 12:59 PM
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.
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