0

I have following htaccess rules in the folder example.com/folder/index.php

RewriteEngine On
RewriteRule ^(.*)-filter-(.*)\.html$ $1.php?filter=$2
RewriteRule ^(.*)\.html$ $1.php

So the URL is rewritten to: example.com/folder/index.html and example.com/folder/index-filter-stuff.html

Now when I echo $_GET["bla"] from example.com/folder/index.html?bla=value it works, I get the value. But when I echo it from example.com/folder/index-filter-stuff.html?bla=value then it's not working. So I get only values from non rewritten parameters when the URL doesn't contain rewritten parameters, what could be the problem?

Eddy Unruh
  • 199
  • 3
  • 9
  • possible duplicate of [.htaccess RewriteRule to preserve GET URL parameters](http://stackoverflow.com/questions/4071155/htaccess-rewriterule-to-preserve-get-url-parameters) – mario Apr 27 '14 at 20:28

1 Answers1

0

Most likely you are missing the QSA flag: "query string append":

RewriteEngine On
RewriteRule ^(.*)-filter-(.*)\.html$ $1.php?filter=$2 [QSA]
RewriteRule ^(.*)\.html$ $1.php [QSA]

I suggest you take a look at the excellent documentation of apaches rewriting module. It explains such things in detail and has lots of really good examples.

arkascha
  • 41,620
  • 7
  • 58
  • 90