T
T
T3R3AND2021-01-18 16:36:03
htaccess
T3R3AND, 2021-01-18 16:36:03

How to avoid repeated GET parameter?

Hello! There is a .htaccess rule: RewriteRule ^(.*)$ index.php?module=$1 [L,QSA]
For example, if a roles user follows this path /123?module=123f , 123 is already a module, but it will be 123f .

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2021-01-18
@T3R3AND

Remove the QSA flag.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?module=$1 [L]

If you want to leave the possibility to pass other parameters.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?%{QUERY_STRING}&module=$1 [L]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question