2012-10-08 92 views
5

我无法找到关于在子文件夹中执行Laravel安装的任何信息。在子文件夹中安装Laravel

它甚至可以做到这一点?还是Laravel需要在根目录安装?

我的主机提供商不允许我创造VirtualHosts,我需要安装Laravel应用程序一起什么目前在那里...

UDPATE:原来,这主要是一个.htaccess问题:

<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 
+0

喜@Pierlo Upitup,你是如何解决你的问题的。你能详细解释一下吗?问候。 –

回答

6

首先,拿在考虑这个答案是这只是为了工作,我不知道任何的影响,这可能在安全性,由于每个文件夹中的站点的公共部分之中。第二,我只是试着用一个准系统laravel安装,所以我不确定这是否可以在开发后期产生效果(我的猜测并不是,但你永远不知道)。

1)public文件夹的所有内容复制根laravel文件夹(这是你的子文件夹)

2)您现在可以删除空public文件夹

3)编辑index.php和改变

// -------------------------------------------------------------- 
// Set the core Laravel path constants. 
// -------------------------------------------------------------- 
require '../paths.php'; 

// -------------------------------------------------------------- 
// Set the core Laravel path constants. 
// -------------------------------------------------------------- 
require './paths.php'; 

4)编辑paths.php和改变

// -------------------------------------------------------------- 
// The path to the public directory. 
// -------------------------------------------------------------- 
$paths['public'] = 'public'; 

// -------------------------------------------------------------- 
// The path to the public directory. 
// -------------------------------------------------------------- 
$paths['public'] = '.'; 

5)编辑在laravel文件夹中的.htaccess文件,使之重定向没有更多进入公众

<IfModule mod_rewrite.c> 
    RewriteEngine on 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule> 
+0

好吧,将公用文件夹的所有内容移动到根目录中已经不是我要查找的内容,因为css,img和js文件夹会与其他安装冲突。 另外,正如我所说的,请记住在根级别上已经有了一个自定义的框架,因此覆盖/index.php文件是没有选择的。 –

+0

通过根文件夹我指的是根laravel文件夹,你可以把它放到你的安装文件夹中,然后在www.yourdomain.com/laravelfolder访问它 – mrzard

+0

我按照你的指示,但我得到一个500内部服务器错误。那可能是什么? –

相关问题