Issue with simple HTTP requests with Laravel Routes.php

ぐ巨炮叔叔 提交于 2019-12-24 09:00:58

问题


I am trying to get the most basic functionality to work on Laravel and am having a really hard time. I want the client to be able to send a request in the form of www.mysite.com/laravel/public/this and have the home.index view file returned from the home folder, all of this being determined by routes specified in the laravel/application/routes.php file.

The following function, included in the installation, routes correctly and demonstrates that www.mysite.com/laravel/public works to take the http request from the user and return the correct data

Route::get('/', function()
{
return View::make('home.index');
});

But as soon as I change '/' to 'this' and send the request...

Route::get('this', function()
{
return View::make('home.index');
});

I get "No input file specified." message. How is this happening? I have tried it with localhost and it works fine but I want it to work on my godaddy shared php server


回答1:


Its too simple.

Go to htaccess in public directory and change

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

to

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

http://forums.laravel.io/viewtopic.php?id=1508

I cannot believe a mere character has caused me so much frustration



来源:https://stackoverflow.com/questions/15488910/issue-with-simple-http-requests-with-laravel-routes-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!