Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$_GET array is empty

My Kohana 3 application makes use of a fair bit of $_GET parameters. However when I deployed the application I got a blank page with just the text "No input file specified". I quickly found the solution to this seemingly common problem by changing in my .htaccess file:

RewriteRule .* index.php/$0 [PT,L]

to

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

However now my $_GET array has lost all the parameters passed. Any page that doesn't require $_GET is working fine. I'm not too good with .htaccess files, but from what I can tell, adding the ? has replaced the $_GET array with the uri.

I've also tried

RewriteRule .* index.php/?$0 [PT,L]

and

RewriteRule .* index.php?/$0 [PT,L]

but to no avail.

Below is my .htaccess file in full (mostly the same as example.htaccess)

# Turn on URL rewriting
RewriteEngine On

# Installation directory
RewriteBase /

# Protect hidden files from being viewed
<Files .*>
    Order Deny,Allow
    Deny From All
</Files>

# Protect application and system files from being viewed
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [F,L]

# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Rewrite all other URLs to index.php/URL
RewriteRule .* index.php?$0 [PT,L]

The closest I've found to a solution was this post: http://forum.kohanaframework.org/discussion/comment/4857/#Comment_4857 However that seems to be for an older version of Kohana, and I'm not sure how this would work in Kohana v3.

like image 311
Jordan Avatar asked Jan 20 '23 12:01

Jordan


1 Answers

Using QSA (Query String Append) should help:

RewriteRule .* index.php?$0 [PT,L, QSA]
like image 165
Pekka Avatar answered Jan 28 '23 12:01

Pekka