5

I've developed a website for a client on my development server, and pushed it to the production server. On both sites, the URL is something like http://www.siteurl.com/blogs/?m=09&y=2012

On the development server, if I var_dump($_GET), I get the values I expect.

On the production server, if I var_dump($_GET), I get an empty array.

I'd post the phpinfo() if it helps, I don't even know what settings could possibly cause this.

Thanks.

7
  • Please check your website; I get a 404 error. Commented Oct 3, 2012 at 18:05
  • 4
    That's not the actual URL, just an example of what I was doing. I'd rather not post the actual URL. Commented Oct 3, 2012 at 18:07
  • Okay, I thought I would see your code there. Anyway, you are using and &, rather than &, which might affect the interpretation. Commented Oct 3, 2012 at 18:11
  • Do you have any rewrite rules on one that aren't on the other? Total long shot. Commented Oct 3, 2012 at 18:13
  • 4
    @LOLapalooza - you might want to use 'example.com' for fake urls; it's more obvious it's an example (and guaranteed to be an invalid, since 'example.com' is reserved for this usage). Commented Oct 3, 2012 at 18:14

2 Answers 2

5

I had the same issue.

See this forum discussion: http://forum.kohanaframework.org/discussion/734/_get-empty/p1

Solved replacing this:
RewriteRule .* index.php/$0 [PT,L]

for this:
RewriteRule .* index.php?$0 [PT,L]

Add New Rule to .htaccess. It will works

RewriteRule ^[A-Za-z]+$ index.php?$1 [QSA,L]
Sign up to request clarification or add additional context in comments.

1 Comment

I don't have that exactly, but something similar. My htaccess skills are not very good. What should I change here? <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /subdir/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /subdir/index.php [L] </IfModule>
2

As I was saying above, you need the QSA flag (read "query string append") to pass the query string to PHP:

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /subdir/
    RewriteRule ^index\.php$ - [L,QSA]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /subdir/index.php [L,QSA]
</IfModule>

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.