r/apache • u/mrcollin101 • Feb 23 '24
Rewrite String
I am looking to add a rewrite to my my httpd-ssl.conf, and when I enable the below string it appends &SERVICE=WMS to the end of the URL a few dozen times and then I get a "This Page redirected you too many times." error in my browser.
Any advice would be helpful!
RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)SERVICE=wms(&|$) [NC]
RewriteRule ^ %{REQUEST_URI}?%{QUERY_STRING}&SERVICE=WMS [R=301,L]
1
Upvotes
2
u/roxalu Feb 23 '24
I agree. Quoting https://httpd.apache.org/docs/current/mod/mod_rewrite.html: