Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

260
Views
Add get-parameter to rewrite_rule in .htaccess does not work

We are on the way to develop a small router via the .htaccess file. Now we are trying to pass through a get-parameter in a rewrite_rule. The problem is, that the get parameter is not passed through successfully.

For example we have the following url:

https://example.com/shop-verifizierung_2c1c759546318feb3177d7d2a023400a.html

and the following rule:

RewriteRule ^(.*)-verifizierung_(.*).html$ index.php?seite=$1&webshopparameter=verifizierung&code=$2 [L,QSA]

That example works fine and the parameters are set correctly but now we have to add an additional get-parameter token like that:

https://example.com/shop-verifizierung_2c1c759546318feb3177d7d2a023400a.html?token=6TT38831GN100844

So we expand the rewrite_rule:

RewriteRule ^(.*)-verifizierung_(.*).html?token=(.*)$ index.php?seite=$1&webshopparameter=verifizierung&code=$2&token=$3 [L,QSA]
                                         ^^^^^^^^^^^^                                                          ^^^^^^^^^

But it wont work as expected. We also tried to use {QUERY_STRING} but the result is thesame. Where is the problem here? Thanks for your help!

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

With your shown samples, please try following htaccess Rules. You could use THE_REQUEST variable which will be more suitable more your current condition here.

Also please make sure to clear your browser cache before testing your URLs.

RewriteEngine ON
RewriteCond %{THE_REQUEST} \s/(.*?)-verifizierung_(.*?)\.html\?token=(\S+)\s [NC]
RewriteRule ^  index.php?eite=%1&webshopparameter=verifizierung&code=%2&token=%3 [L,QSA]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!