From: "Bob Haroche" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, August 16, 2004 6:40 PM
Subject: Re: Best way to redirect .htm pages to .cfm?
> Adrian Lynch wrote:
> > Meta redirect or JS, not sure which is better for search engines
> > though, I'd
> > guess meta.
>
> I believe both will give you a pretty decent chance of getting banned
> from search engines. They don't like client side re-directs.
That's what I was concerned about. I'd heard this years ago but didn't
know if it was still true.
I'm close to an alternative, but...
I found out that ideally, google and others would like you to return an
HTTP 301 (Moved Permanently) status code. I believe it's so they can
remove the old page from their index. Which is what I'd like as well.
I was able to get a custom 404 page pointed at a CF template. Problem now
is that no matter what I do in the template using CFHEADER, IIS always
morphs my 301 HTTP status code into a 302 code, with its own page output.
If I do a GET using something like wfetch, then I can see IIS' output - it
has the correct new .cfm page location, but a 302 status code.
Somehow I think the custom error page approach isn't going to get me
anywhere do to the way IIS operates.
<cfset oldpages = "/services.htm,/clients.htm">
<cfset thispage = [process some cgi variables...]>
<cfif ListFindNoCase(oldpages, thispage)>
<cfheader statuscode="301"
statustext="Moved Permanently">
<cfheader name="Location"
value="#ReplaceNoCase(url, '.htm', '.cfm', 'one')#">
<cfabort>
<cfelse>
<cfheader statuscode="404"
statustext="Not Found">
</cfif>
<html>[... page output for genuine 404 errors]</html>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

