I am rewriting using .htaccess to remove ".html" extensions from my website. However, I use the URL in a function to pass a parameter to another page (mysite.com/locations#12345)
My rewrite rules are the following:
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
I tried doing this:
RewriteCond %{THE_REQUEST} /locations/([^.]+) [NC]
RewriteRule ^ /locations%1 [NC,L,R]
But I get "mysite.com/locations%20HTTP/2#12345"