2

my web site generate the links dynamically and after some period of time the links will be expired and will be no more valid.

I redirect such links to a static page with a statuscode 301 which for google only means that the old link should be replace with this new link.

But what I want is that I should be able to set the statuscode to 410 and should be able to redirect the page to my static page so that the search engine should remove such links from their indexes.

The problem I am facing is that by setting header like

<cfheader statuscode="410" statustext="Gone"> 
<cfheader name="Location" value="/removed.cfm">  
 <cfabort>  

the browser does't redirct to new location.

James A Mohler
  • 11,060
  • 15
  • 46
  • 72
user160820
  • 14,866
  • 22
  • 67
  • 94

2 Answers2

5

Status 410 is not a redirect. It is more similar to a 404 than a 301/302. Use status 301 for a permanent redirect, and Google should recognize that the old page has been replaced, and browsers will redirect.

Ben Doom
  • 7,865
  • 1
  • 27
  • 30
2

Think cflocation with statusCode is what you want. From manual:

<cflocation
    url = "URL"
    addToken = "yes|no"
    statusCode = "300|301|302|303|304|305|307" />

I'm not sure if it work with code 410, but I would agree with Ben that 301 sounds better here.

Sergey Galashyn
  • 6,946
  • 2
  • 19
  • 39
  • 2
    4xx codes are "stop" codes, used for missing, gone, forbidden, bad authentication, etc. Basically, they tell the browser to stop what it is doing. 3xx messages are "redirect" messages, for proxy oinstructions, moved temporarily or permanently, unmodified (redirect to cache if available), etc. He wants a 3xx code, not 410. – Ben Doom May 23 '11 at 17:49