donglian3061 2016-08-04 16:42
浏览 59

除“/”之外的共享主机页面上的Laravel未显示

Whatsoever I put in Route('/') Directory seems to show up the page:

Route::get('/', function () {
    return view('coming-soon');
});

But all other routes dont seem to work. here :

Route::get('/', function () {
    return view('coming-soon');
});

Route::get('/home', function () {
    return view('home');
});


Route::get('/about', function () {
    return view('about');
});

Route::get('/portfolio', function () {
    return view('portfolio');
});

Route::get('/support', function () {
    return view('support');
});

Route::get('/contact', function () {
    return view('contact');
});

Route::get('/faq', function () {
    return view('faq');
});

Route::auth();

There are no controllers yet defined. Its just plain html and css files.

In Views :

I have files :

home.blade.php
about.blade.php
contact.blade.php
coming-soon.blade.php
faq.blade.php
support.blade.php
portfolio.blade.php

in Layouts Folder
    - app.blade.php

In order for the framework to work I have put all the files in public folder to root directory. That is, css, html(or blade.php files), js folder, images folder

Everything seems fine just that other url's trigger : Error 500 - Internal Server Error If I go to www.example.com/public/about or /home or /contact it works but then no css property applied.

How can I best place the files in Shared-Hosting for it to work.

Any Help is Appreciated!!

  • 写回答

1条回答 默认 最新

  • dongmu5106 2016-08-04 16:48
    关注

    Change

    require __DIR__.'/../bootstrap/autoload.php'; to require __DIR__.'/../YourProjectName/bootstrap/autoload.php'; and

    $app = require_once __DIR__.'/../bootstrap/app.php'; to $app = require_once __DIR__.'/../YourProjectName/bootstrap/app.php';

    on index.php

    评论

报告相同问题?

悬赏问题

  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)