Reputation: 2581
I created a rss feed for my site and the url looks like this: http://abcde.com/rss/rss.php
I want an url like this: http://abcde.com/rss/rss.xml
How to do this, please help me.
Thanks in advance.
Upvotes: 0
Views: 1101
Reputation: 23972
.htaccess rules?
If you want all .xml files to point to php files, use these.
RewriteEngine On
RewriteBase /rss
RewriteRule ^(.*).xml$ $1.php [R=301]
This should also work:
RedirectMatch perm ^/rss/(.+)\.xml$ http://yoursite.com/rss/$1.php
Otherwise, use the code Jason McCreary suggested:
RewriteEngine On
RewriteBase /rss
RewriteRule ^rss.xml$ rss.php [L]
Which will only rewrite rss.xml to rss.php.
Upvotes: 2
Reputation:
I recommend to generate a static xml file via php and give access to this file.
Invoking php script that reads back-end database every time to generate rss feed, especially when there are many users, may affect on your server performance.
Generate a static xml file and update it every time when you update your web-site.
And provide link to this static xml file.
Upvotes: 1