How to hide RSS page from everyone except FeedBurner

折月煮酒 提交于 2019-12-24 09:38:59

问题


I want to hide my feed from everyone except FeedBurner.

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

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

How would you do it?

My blog is written in PHP. (custom code)

Additional info:

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

My rss page is: domain.tld/feed/


回答1:


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

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




回答2:


The following page of Feedburner's documentation might interest you : How do I redirect traffic from my site's original feed to my FeedBurner feed?




回答3:


You can check the user agent for FeedBurner, but as user agents can be spoofed I wouldn't be too dependant on this approach if the RSS hiding is being done for security reasons.



来源:https://stackoverflow.com/questions/5133066/how-to-hide-rss-page-from-everyone-except-feedburner

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!