$ _GET array is empty

My Kohana 3 uses the fair $ _GET parameter bit. However, when I deployed the application, I received a blank page with the text "No input file." I quickly found a solution to this seemingly common problem by modifying the .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 does not require $ _GET works fine. I'm not too good with .htaccess files, but from what can I say by adding? replaced the $ _GET array with uri.

I 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 its entirety (basically 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 found a solution was this post: http://forum.kohanaframework.org/discussion/comment/4857/#Comment_4857 However, this seems like an older version of Kohana, and I'm not sure how this will work in Kohana v3.

+4
source share
3 answers

Using QSA (Query String Append) should help:

 RewriteRule .* index.php?$0 [PT,L, QSA] 
+6
source

I need to make two changes in the K03 example.htaccess example to make it work:

RewriteRule ^(application|modules|system)/ - [F,L] instead

RewriteRule ^(?:application|modules|system)\b - [F,L] (which gives an internal server error)

RewriteRule .* index.php [L] instead

RewriteRule .* index.php/$0 [PT] (which gives a message with no input file.)

Here is my .htaccess file for K03:

 # Turn on URL rewriting RewriteEngine On # Installation directory #RewriteBase / # Protect hidden files from being viewed Order Deny,Allow Deny From All # Protect application and system files from being viewed RewriteRule ^(application|modules|system)/ - [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 [L] 
+3
source

It turns out exactly the same error, which, it seems to me, is caused by the fact that my apache is working in fastcgi mode. Any of the above solution with htaccess rules worked for me, but on a network search I found this rule:

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

and just replace it with the old one: RewriteRule .* index.php/$0 [PT,L]

0
source

Source: https://habr.com/ru/post/1339338/