-1

example adress: mysite.com/search/?q=notebook

my rewrite rule;

RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)$ example.php?param1=$1&param2=$2

this rule ignore ?q= characters. How should be htaccess rewrite rule for accept this special character?

anubhava
  • 761,203
  • 64
  • 569
  • 643
  • Maybe you need to use [the B flag](http://httpd.apache.org/docs/2.2/en/rewrite/flags.html#flag_b)? (Only guessing, because problem description isn’t that clear.) – CBroe Oct 13 '14 at 12:06

1 Answers1

1

Looks like you just QSA flag here:

RewriteRule ^([\w-]+)/([\w-]+)$ example.php?param1=$1&param2=$2 [L,QSA]
  • QSA (Query String Append) flag preserves existing query parameters while adding a new one.
anubhava
  • 761,203
  • 64
  • 569
  • 643