There are static html files called blahblah.html?somestring. I’m always get 404 error.
When I try blahblah.html%3fsomething – it semi-works (shows html source as text), but ` need URLs to be exactly with question sign.
How to make Apache show to this files with exact URL containing “?”.
I tried to rename file to “blahblah.html-somestring” + rule in .htaccess
RewriteRule ^/(.*).html\?(.*)$ /$1.html-$2 [NE]
it doesn’t help
THIS HELPED ME:
I renamed all files to blahblah.html-somestring.html + added this to .htaccess:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} !^$
RewriteRule ^[^.]+\.html/?$ %{REQUEST_URI}-%{QUERY_STRING}.html? [L,NC]
Enable mod_rewrite and .htaccess through
httpd.confand then put this code in your .htaccess under DOCUMENT_ROOT:This will rewrite
blahblah.html?somestringtoblahblah.html-somestring. However how the content will be served fromblahblah.html-somestring, you will have to figure out.