schussat Posted March 7, 2004 Posted March 7, 2004 Hi everybody- In our long thread of mod_rewrite conversations, I have the next question. It seems that making sense of mod_rewrite just doesn't get any easier. The introduction to the module says ``The great thing about mod_rewrite is it gives you all the configurability and flexibility of Sendmail. The downside to mod_rewrite is that it gives you all the configurability and flexibility of Sendmail.'' Anyway, that aside, I've just switched my weblog over to textpattern. As far as I can tell, Textpattern doesn't generate a static XML feed; it's generated by a call to "index.php?rss=1" instead. Can I redirect requests for my old static file to this one, perhaps via mod_rewrite? I'm particularly thinking about anybody who reads my site with an aggregator (hey, I'm being generous to myself thinking there are that many of them, but I figure I ought to cover all the bases!), who won't see the update. So, can I redirect requests to index.xml to index.php?rss=1 instead? Quote
MikeJ Posted March 7, 2004 Posted March 7, 2004 (edited) Yep. Just take index.xml and rewrite it as whatever you want: >RewriteEngine On RewriteRule ^index\.xml$ index.php?rss=1 [L] ^index\.xml = the file request to rewrite index.php?rss=1 = what you are rewriting it to [L] = last rule... don't rewrite any farther The result is that it will look like index.xml exists as a file. More can be found here: URL Rewriting Guide mod_rewrite Reference Documentation Edited March 7, 2004 by TCH-MikeJ Quote
TCH-Don Posted March 7, 2004 Posted March 7, 2004 MikeJ, nice links Thumbs Up Moved for better organization of the forums. Quote
schussat Posted March 7, 2004 Author Posted March 7, 2004 Fantastic, MikeJ -- seems to work perfectly. Thanks! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.