I am attempting to match a URL like
http://www.example.org/?h=b1c60d1bf7c7119fef9fc726068e1418166.xml
or
?h=b1c60d1bf7c7119fef9fc726068e1418166.jsonp&callback=testing
and re-write it like this:
?h=b1c60d1bf7c7119fef9fc726068e1418166&output=true&format=true&data_type=xml
or
?h=b1c60d1bf7c7119fef9fc726068e1418166&output=true&format=true&data_type=jsonp&callback=testing
Here is the .htaccess file with the regex I came up with.
RewriteEngine On
RewriteBase /
RewriteRule ^/?\?h=([a-z0-9]+)\.(xml|json|jsonp|rss)(\&callback=[a-z_0-9]+)?$ ?h=$1&output=true&format=true&data_type=$2&callback=$3 [L,NC,QSA]
Any ideas why this isn't matching? I've tested this in the server environment and on http://htaccess.madewithlove.be/ with no luck.