开发者

Coldfusion Redirecting a page with statuscode 410

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜