0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^shop/(.*)$ /shop.php?page=$1 [L]

That works mostly, but if I have a page for example: shop.php?page=home&search=foo then the search=foo is ignored.

Can anyone please explain what is going on?

Youri
  • 15
  • 5
  • You need to use `QSA` for Query String Append (so in your case `[L,QSA]`. See [this Q for syntax](https://stackoverflow.com/questions/33104868/htaccess-appending-to-query-string-with-qsa-without-redirect) – Martin May 18 '23 at 13:22

1 Answers1

0
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^shop/(.*)$ /shop.php?page=$1 [L,QSA]
Youri
  • 15
  • 5
  • This answer does nothing to explain what the problem is to the OP. Code only answers are not a good fit for Smack Overflow. – Martin May 18 '23 at 20:52