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.

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top