Apache, resolve file names using ??

I want to make a static copy of the site while preserving the existing URLs. The problem is that the URLs looked like this:

http: //mysite/index.php? id = XXX

and Apache doesn't want to search index.php file? id = XXX. Instead, it interprets the request as the file "index.php" with the request "id = XXX".

How can I ask Apache to stop processing a question mark?


Finally, my solution:

1) rename files from "index.php? Id = XXX" to "index.php_id = XXX"

2) Add to .htaccess:

RewriteEngine On
RewriteCond %{ENV:REDIRECT_STATUS} =""
RewriteCond %{QUERY_STRING} !=""
RewriteRule ^(.*)$ $1_%{QUERY_STRING} [L]
+5
source share
1 answer

Escape ? like %3f: http://www.example.com/index.php%3fid=XXX.

, Apache . , , .

+5

All Articles