Quick issue = quick solution.
How to trim out a QUERY_STRING from mod_rewrite redirect?
RewriteEngine On RewriteCond %{QUERY_STRING} z=([0-9]*)&x=([0-9]*)&y=([0-9]*)&r=mapnik RewriteRule tiles.php http://a.tile.openstreetmap.org/%1/%2/%3.png [NC,L,R=301]
After accessing file:
tiles.php?z=6&x=35&y=21&r=mapink
you will be redirected to
http://a.tile.openstreetmap.org/6/35/21.png?z=6&x=35&y=21&r=mapink
The query string params are appended by default. To trim out the parameters, just place an ending ?
(question mark) to redirect rule. That means, that there should be no parameters. Finally:
RewriteEngine On RewriteCond %{QUERY_STRING} z=([0-9]*)&x=([0-9]*)&y=([0-9]*)&r=mapnik RewriteRule tiles.php http://a.tile.openstreetmap.org/%1/%2/%3.png? [NC,L,R=301]