lostlinkpr
asked on
Apache mod_rewrite and wordpress RSS feed
I'm changing my blog to wordpress and and don't want to lose the people that already have my rss feed. The old link to my RSS feed was /blog/index.cfm?event=show BlogRss The new one is /tech/feed/
I've done many URL rewrites in the past but can't find what I'm doing wrong here or if this is a problem with WordPress itself. The rewrite rull I'm putting in my .htacces file is below.
When I execute the code wordpress displays a page not found error.
Any insights on this?
I've done many URL rewrites in the past but can't find what I'm doing wrong here or if this is a problem with WordPress itself. The rewrite rull I'm putting in my .htacces file is below.
When I execute the code wordpress displays a page not found error.
Any insights on this?
RewriteCond %{QUERY_STRING} ^event=showBlogRss$
RewriteRule ^blog/index\.cfm$ /tech/feed? [NC,L]
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Solved!
The problem with the invalid XML was my fault as I had once edited one of the php files (index.php) and left extra characters at the bottom of the file causing extra lines when the XML was created making it invalid. Having said that both solutions work (external or internal redirect). Since both work, I prefer the external redirect as Caterham suggested because it tells the search engines and RSS feeders that the location of the RSS has changed permanently. Below is a code snippet using Caterham solution pointing to the direct WP link instead of the permalink.
Thanks for the help!
The problem with the invalid XML was my fault as I had once edited one of the php files (index.php) and left extra characters at the bottom of the file causing extra lines when the XML was created making it invalid. Having said that both solutions work (external or internal redirect). Since both work, I prefer the external redirect as Caterham suggested because it tells the search engines and RSS feeders that the location of the RSS has changed permanently. Below is a code snippet using Caterham solution pointing to the direct WP link instead of the permalink.
Thanks for the help!
RewriteCond %{QUERY_STRING} ^event=showBlogRss$
RewriteRule ^blog/index\.cfm$ /tech/?feed=rss2 [R=301,NC,L]
ASKER
However on some rss readers (i.e. firefox works just fine but OMEA reader fails) I get an error saying "the address does not point to a valid html or xml" this is with or without a rewrite so it seems like a Wordpress RSS problem. Anyways your solution with the 301 seems like it would work with the readers too so as soon as I can test it I'll give you the points.
thank you!
Open in new window