2016-10-28 55 views
2

有人知道如何让laravel公共文件夹中到另一个文件夹laravel一些途径,目前的文件夹结构:Laravel公共/子文件夹中的另一个源代码

public 
    index.php <==== this is laravel index.php 
    .htaccess <==== this is laravel default .htaccess 
    subfolder <==== this is not laravel php code files 
在我的本地

,我可以访问子文件夹的网址http://example.dev/subfolder

但在我的直播现场,http://example.com/subfolder扔我

NotFoundHttpException的错误RouteCollection.php线161:

这里是laravel .htaccess文件

<IfModule mod_rewrite.c> 
    <IfModule mod_negotiation.c> 
     Options -MultiViews 
    </IfModule> 

    RewriteEngine On 

    # Redirect Trailing Slashes If Not A Folder... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)/$ /$1 [L,R=301] 

    # Handle Front Controller... 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule^index.php [L] 
</IfModule> 

本地/在线服务器的源代码是同步的,我想这是一些服务器的设置问题,但我不知道什么是关键字,欣赏所有帮助

顺便说一句,laravel 5.2版本

回答

0

在laravel,而不是路由到一个文件夹,你让路由到特定的页面。

如果你有一个像

public 
    index.php <==== this is laravel index.php 
    .htaccess <==== this is laravel default .htaccess 
    subfolder <==== this is not laravel php code files 
    test.blade.php <==== this is a simple webpage 

的结构,你想它的路线test.blade.php,你的路由应该是这样的

在你routes.php文件:

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

因此,当您打开http://example.dev/test时,它会显示页test.blade.php的内容,它位于内

+0

还有一些其他程序员在纯php中完成的代码,所以必须这样做 – user259752

0

检查httpd.conf设置。寻找这个文件

DocumentRoot "C:/xampp/htdocs" 
<Directory "C:/xampp/htdocs"> 

在当地和现场场地比较设置

+0

这两个本地/生活都指向/路径/到/源/公共,任何问题呢? – user259752

0

发现问题

使用WHM /的cPanel直播服务器,需要

AllowOverride All 

添加到httpd.conf

相关问题