I've just taken on hosting of an ancient site that was converted from asp to static html, consisting of about 6,000 files. However, my server doesn't like the filenames, giving a 404 error. The URLs are all of the form:
filename.asp?id=123&a=something.html
where id
is always an integer and a
is always a string of characters & numbers.
Is there any way I can use htaccess and mod_rewrite to tell it that the question mark is part of the URL rather than signifying a query string?
Best Answer
You probably already know you are not the first person to have this need :)
The key is the combination of adding a redirect and NE/noescape to ensure apache doesn't escape what we don't want escaped.
The above rule will mean that the entire site under this rewrite will treat
?
as part of the filename. If you need to have it match yourfilename.asp
- just add it to the RewriteRule