1

I am having a bit of trouble with not being able to pass a get variable when I'm using an htaccess file.

I have a rewrite rule that looks like this:

RewriteRule user/([0-9]+) user.php?uID=$1&user

And I have a small script that looks like this:

<?php if(isset($_GET['section'])){ /*DO STUFF HERE*/ } ?> //this doesn't run

The problem I'm having is if I go to for example:

www.example.com/user/2?section=info

the 'section' part of the URL won't get passed in.

1
  • Long story made short: You need a [QSA] flag on the RewriteRule. Commented Aug 18, 2014 at 2:22

1 Answer 1

1

In order to parse the query string in a rewritten URL, you must pass the [QSA] (query string append) flag to it, like so:

RewriteRule user/([0-9]+) user.php?uID=$1&user [QSA]
Sign up to request clarification or add additional context in comments.

1 Comment

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.