douxiuar885064 2013-03-18 23:33
浏览 84
已采纳

使用Laravel Routes.php的简单HTTP请求问题

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条回答 默认 最新

  • dtds8802 2013-03-19 00:21
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等
  • ¥15 matlab 用yalmip搭建模型,cplex求解,线性化处理的方法
  • ¥15 qt6.6.3 基于百度云的语音识别 不会改
  • ¥15 关于#目标检测#的问题:大概就是类似后台自动检测某下架商品的库存,在他监测到该商品上架并且可以购买的瞬间点击立即购买下单