denlau
denlau

Reputation: 1016

How to enable url-parameters in an MVC-framework

I am currently wanting to enable $_GET parameters in my framework.

My current htaccess-file is like this, BUT it doesn't pass the ?param=param :(

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{THE_REQUEST} \ /{2,}([^\?\ ]*)
RewriteRule ^ /%1 [L,R=301,QSA]

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

RewriteRule ^.*$ index.php?url=$0 [NC,L]

</IfModule>

When I try to go to this URL:

http://www.domain.com/test?test=test

All that gets passed is "test"

How can I make it possible to also pass $_GET-parameters?

Upvotes: 0

Views: 458

Answers (1)

S&#233;bastien
S&#233;bastien

Reputation: 12139

You need to add QSA to your RewriteRule:

RewriteRule ^.*$ index.php?url=$0 [NC,L,QSA]

QSA stand for Query String Attach

Upvotes: 2

Related Questions