Forum Moderators: phranque

Message Too Old, No Replies

.htaccess rewrite for rss feed url

need to do a simple rewrite to make my stuff work with feedburner

         

gilahacker

6:47 pm on Feb 25, 2005 (gmt 0)

10+ Year Member



I've got a minor problem, and knowing little to none about this stuff, I'm stuck.

DaveAtIFG recommended I post it here

I need to redirect this:
http://www.usfranchisenews.com/index2.php?option=com_rss&feed=RSS2.0&no_html=1

to this:
http://feeds.feedburner.com/usfranchisenews

for everyone except feedburner, which I understand is done with this line:
RewriteCond %{HTTP_USER_AGENT}!FeedBurner

now I've gotten this far:
RewriteCond %{HTTP_USER_AGENT}!FeedBurner
RewriteRule ^index2\.php?option=com_rss&feed=RSS2.0&no_html=1$ [feeds.example.com...] [R, L]

(the guts of this came from feedburner's forums)

but can't seem to escape the characters correctly (tried all different combinations) or something as it's not working

any ideas?

Thanks in advance
-Jason

btw: the purpose of all this is so that anyone using my old rss url gets the new feedburner url (which I can track) but feedburner can still grab my rss feed from the original url (without an infinite loop)

[edited by: jdMorgan at 8:20 pm (utc) on Feb. 25, 2005]
[edit reason] Removed specifics & Sig per TOS. [/edit]

jdMorgan

8:19 pm on Feb 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Jason,

You'll need to use RewriteCond [httpd.apache.org] to access/test the query string:


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !FeedBurner
RewriteCond %{QUERY_STRING} ^option=com_rss&feed=RSS2.0&no_html=1$
RewriteRule ^index2\.php$ http://feeds.example.com/myfeedname? [R=301,L]

I added the first two "setup" directives for others who may read this thread later.

Jim

gilahacker

10:22 pm on Feb 25, 2005 (gmt 0)

10+ Year Member



SWEET!

Thanks so much! Just so you know I posted the answer in the feedburner forums where I had asked the same question (gave you credit of course).

although webmasterworld may slaughter the link

-Jason

[edited by: jdMorgan at 11:45 pm (utc) on Feb. 25, 2005]
[edit reason] Removed specifics per TOS. [/edit]