1

I have a feed.xml file containing my RSS feed and I'd like to rewrite the url example.com/feed.xml to example.com/feed.rss.

I've tried with this code:

RewriteEngine On
RewriteBase /
RewriteRule ^feed.xml$ feed.rss [L]

But it doesn't work. When I access the feed.xml, it displays the feed and when I access the feed.rss I have an Error 404.

I know that is possible but I think something is wrong with my code.

cyclone200
  • 357
  • 6
  • 20

1 Answers1

1

Just swap the pattern and substitution in your RewriteRule directive:

RewriteEngine On
RewriteBase /
RewriteRule ^feed\.rss$ /feed.xml [L]
hjpotter92
  • 75,209
  • 33
  • 136
  • 171