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 7897471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:10:29+00:00 2026-06-03T08:10:29+00:00

I have a quite odd mystery. I have a rather simple Apache Rewrite and

  • 0

I have a quite odd mystery. I have a rather simple Apache Rewrite and for some odd reason it is messing up my php Superglobals. First off the Rewrite is as follows:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

When this rule is in place the only Superglobals that are $_GET and $_REQUEST (of course $REQUEST does because it gets them from $_GET, …). No matter what I put in the URL I only ever receive /index_php as the only key and it has no value. At first I thought I had messed something up in my code but as the first line of the index file I tried the following:

foreach($_GET as $key => $value)
{
    echo "$key = $value<br/>";
}
foreach($_POST as $key => $value)
{
    echo "$key = $value<br/>";
}
foreach($_REQUEST as $key => $value)
{
    echo "$key = $value<br/>";
}

The only thing printed is “/index_php = ” twice. I’ve messed with a couple rewrites before but clearly I’m doing something incorrect. As a side note this is my expected behavior:

URL: localhost/users/dashboard?item=id 

Which would give me the $_GET superglobal with key: item, value: id. Any help is greatly appreciated.

  • 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-06-03T08:10:30+00:00Added an answer on June 3, 2026 at 8:10 am

    You need to pass the original query string in your rewrite rule:

    RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
                                        ^^^
    

    That way, regardless of the new values that you might add in the future, the old ones will get passed as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have quite a strange problem with PHP and Apache on my local testing
I have a very odd issue trying to run this quite simple C program
This is quite odd, but I have a script that was until now calling
This is quite odd, because I have a Character class that can access Frame.dimension.getWidth();
Getting some odd behaviour in a Perl script that I don't quite understand. I'm
Alright, I have a rather odd question here. I feel much more comfortable writing
I have quite an odd problem here - I am using jquery for resizing
I have a rather odd CSS problem. I am bringing in an Internet Explorer
I have quite a problem concerning the use of relational database concepts in Delphi
I have quite big document in html format that generated from Microsoft Word. It

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.