--- title: htaccess and redirect subtitle: how to get htaccess working and redirect feed to feedburner date: 2012-01-12 keywords: [apache, web, htaccess] --- Okay, so after my [post about htaccess][htaccess] the other day, I still had one more thing to do before I could get the rewrite rules working. I wanted to redirect requests for my [podcast][tmc] rss feed (eg any reqests for the specific `feed.xml` file) to [feedburner][], but whenever I put the rewrite rules into my `.htaccess` file I would keep seeing an "internal server error". I made the following changes to get it working. This is for [ubuntu][], but should work for any [apache][] unix install. First, I surronded the rewrite rules with `` flags, which stopped the "internal server error" showing to any request no matter the url. RewriteEngine on RewriteCond %{HTTP_USER_AGENT} !FeedBurner RewriteRule ^feed\.xml$ http://feeds.feedburner.com/themarshcast [R=301,L] This meant [the marsh cast][tmc] site would work again, but requests for `feed.xml` still wern't being redirected. I then found on *Mehdi Behamins blog*[dead link] that I had to enable the apache module rewrite by runing sudo a2enmod rewrite and restarting apache with sudo service apache2 restart Now requests for `feed.xml` go to the [feedburner feed][tmcfeed] url. [htaccess]: 2012-01-05.htaccess.html [ubuntu]: http://www.ubuntu.com/ [apache]: http://en.wikipedia.org/wiki/Apache_HTTP_Server [feed]: http://podcast.marsh.ws/feed.xml [feedburner]: http://feedburner.google.com/ [tmc]: podcasts.html [tmcfeed]: http://feeds.feedburner.com/themarshcast