php - Laravel $_GET parameters are not received in controller -



php - Laravel $_GET parameters are not received in controller -

i newbie laravel framework.

i trying out simple url "http://localhost/test?code=value" , when trying access value of code in controller $_get["code"] or input::get('code'), not access value in controller.

i using digitalocean server nginx server.

here .htaccess file in project

<ifmodule mod_rewrite.c> <ifmodule mod_negotiation.c> options -multiviews </ifmodule> rewriteengine on # redirect trailing slashes... rewriterule ^(.*)/$ /$1 [l,r=301] # handle front end controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l]

when tried simple php script in test.php file <?php print_r($_get); ?> can access values. so, believe there no problem server settings.

i tried reply mentioned similar issue laravel stripping $_get parameters didnt work me.

any help appreciated. stuck long time :(

finally solved issue. there mis-configuration in nginx server. in /etc/nginx/sites-available/default, instead of having below configuration try_files $uri $uri/ /index.php?$query_string;, try_files $uri $uri/ /index.php$query_string; without ?. after adding ? became normal.

php .htaccess laravel nginx digital-ocean

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -