1

works fine with 1 GET

    RewriteEngine On
    RewriteRule ^store/([^/.]+)/?$ store.php?store=$1 [L,QSA]    

not working when i add another GET

    RewriteEngine On
    RewriteRule ^store/([^/.]+)/?$ store.php?store=$1&name=$2 [L,QSA]

    localhost/store.php?store=3&name=abc
    -> localhost/store/3/abc

I have a htaccess rewrite rule, it works fine in 1 GET, but i try to add another GET into it and its not working.

2
  • add another GET into it ?? Commented Jan 30, 2014 at 17:55
  • Where is $2 defined? You only have $1 created. Commented Jan 30, 2014 at 18:22

2 Answers 2

1

You need this rule:

RewriteEngine On

RewriteRule ^store/([^/.]+)/?$ store.php?store=$1 [L,QSA]    

RewriteRule ^store/([^/.]+)/([^/.]+)/?$ store.php?store=$1&name=$2 [L,QSA]
Sign up to request clarification or add additional context in comments.

Comments

0

maybe

RewriteRule ^store/([^/.]+)/name/([^/.]+)/?$ store.php?store=$1&name=$2 [L,QSA]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.