Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 458701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:41:53+00:00 2026-05-12T22:41:53+00:00

In my .htaccess, I have the following RewriteEngine On RewriteRule ^users/?$ users.php RewriteRule ^users/([a-z]+)/?$

  • 0

In my .htaccess, I have the following

RewriteEngine On

RewriteRule ^users/?$   users.php
RewriteRule ^users/([a-z]+)/?$   users.php?username=$1

Everything works as intended if I do

http://example.com/users/
http://example.com/users/joeschmoe/

and PHP will read “joeschmoe” as the value for

 $_GET['username']

However, if I do

http://example.com/users/joeschmoe/?foo

PHP will not pick up

 $_GET['foo']

Any idea why this is happening and how I can get it work? Thanks for your time!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T22:41:53+00:00Added an answer on May 12, 2026 at 10:41 pm

    You are probably looking for the “QSA” option to RewriteRule :

    ‘qsappend|QSA‘ (query string append)

    This flag forces the rewrite
    engine to append a query string part
    of the substitution string to the
    existing string, instead of replacing
    it. Use this when you want to add more
    data to the query string via a rewrite
    rule.

    That page also states :

    Modifying the Query String

    By default, the query string is passed
    through unchanged.
    You can,
    however, create URLs in the
    substitution string containing a query
    string part. Simply use a question
    mark inside the substitution string to
    indicate that the following text
    should be re-injected into the query
    string.
    When you want to erase an
    existing query string, end the
    substitution string with just a
    question mark.
    To combine new
    and old query strings, use the [QSA]
    flag.

    In your case, something like this should do :

    RewriteEngine On
    
    RewriteRule ^users/?$   users.php
    RewriteRule ^users/([a-z]+)/?$   users.php?username=$1 [QSA]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following in a .htaccess file redirect 301 /page.php http://domain.com/page Which works
I have in my .htaccess the following code: RewriteEngine On RewriteRule ^/?([^/\.]+)/?$ $1.php [L]
I have the following htaccess to redirect users from www.mysite.com or http://mysite.com to http://mysite.com/subfolder
i have the following .htaccess RewriteEngine On RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?type=Navigation&action=$1 RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?type=Navigation&action=$1 Options
i have following .htaccess RewriteEngine On DirectoryIndex index.php RewriteRule ^([a-zA-Z0-9_-]{3,20})/([^/]+)/([^/]+)?$ index\.php?page=$1&s=$2&o=$3 [L] RewriteRule ^([a-zA-Z0-9_-]{3,20})/([^/]+)?$
I have the following code in my .htaccess: RewriteEngine On RewriteBase / RewriteRule ^index\.php$
I have the following rewrites in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteRule \.(css|jpe?g|gif|png)$
I have the following in a .htaccess file as a test: RewriteEngine on RewriteRule
In my .htaccess file I have defined following rule, RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA] The
I've modified my .htaccess file to have the following statement RewriteCond $1 !^index.php$ RewriteRule

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.