Apache mod_rewrite to catch XML requests
-
03-07-2019 - |
Question
How do I create a apache RewriteRule that catches any request URL ending in .xml, strips off the .xml and passes it to a specific script?
http://www.example.com/document.xml, becomes http://www.example.com/document passed to script.php
Solution
This should do the trick, I believe.
RewriteRule ^(.+)\.xml$ script.php?path=$1
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow