Handling GET with htaccess [duplicate]

2019-09-17 11:36发布

This question already has an answer here:

I have my .htaccess file redirecting all URLs to index.php?url=$1 as shown below:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php?url=$1 [L]

But when the url is authenticate?code=blahblahblah the code= part is not pulled in, therefore meaning I cannot access it when handling the page D: Any help?

2条回答
迷人小祖宗
2楼-- · 2019-09-17 11:57

use RewriteRule ^(.*)$ index.php?url=$1&%{QUERY_STRING} [L] instead

查看更多
地球回转人心会变
3楼-- · 2019-09-17 12:06

You need the [QSA] flag then.

查看更多
登录 后发表回答