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
Was it helpful?

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
scroll top