如何对除 FeedBurner 之外的所有人隐藏 RSS 页面 [英] How to hide RSS page from everyone except FeedBurner

查看:42
本文介绍了如何对除 FeedBurner 之外的所有人隐藏 RSS 页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想对除 FeedBurner 之外的所有人隐藏我的提要.

I want to hide my feed from everyone except FeedBurner.

当 FeedBurner 访问我的 rss 页面时,我希望它们能够抓取.

When FeedBurner visits my rss page, I want them to be able to crawl.

当其他人访问该页面时,它将被重定向到我的 FeedBurner 页面.

When anybody else visits that page, it will be redirected to my FeedBurner page.

你会怎么做?

我的博客是用 PHP 写的.(自定义代码)

My blog is written in PHP. (custom code)

附加信息:

我更喜欢使用 PHP 中的 head("location:") 方法而不是 .htaccess

I prefer to redirect using the head("location: ") method in PHP instead of .htaccess

我的 rss 页面是:domain.tld/feed/

My rss page is: domain.tld/feed/

推荐答案

Feeburner UserAgent 是 FeedBurner/1.0.您可以使用 $_SERVER['USER_AGENT'] 来检测用户代理并重定向除 feedburner 之外的所有人.

The Feeburner UserAgent is FeedBurner/1.0. You can use $_SERVER['USER_AGENT'] to detect the user agent and redirect everyone except feedburner.

您也可以像在 Pascal MARTIN 提供的文档中一样使用 .htaccess.

You can also use .htaccess like in the documentation Pascal MARTIN provided.

这篇关于如何对除 FeedBurner 之外的所有人隐藏 RSS 页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆