本文介绍了Laravel(和通用)的框架设置[公开"夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让 Laravel 的工作在我的环境(甲基苯丙胺),但我陷在这种情况下。

I tried to make Laravel works on my environment (MAMP) but i'm stuck in this situation.

Laravel的的index.php 文件到一个名为公共子文件夹,所以如果我想测试我的应用程序需要使用这个网址<$访问C $ C>的http://本地主机/ laravel /公/ 但我想与 HTTP访问://本地主机/ laravel

The index.php file of Laravel is into a subfolder called "public", so if I want to test my application I need to access it with this url http://localhost/laravel/public/but I want access with http://localhost/laravel

我试图设置与此行的htaccess,但它不工作:

I tried to set an htaccess with this rows but it doesn't work:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule ^(.*)$ public/$1
</IfModule>

我不知道,这htaccess的可以解决这种情况下,我得到Lavarel产生的404。

I'm not sure that this htaccess can resolves this situation, I get a 404 generated by Lavarel.

推荐答案

您需要创建一个虚拟主机。 Dayle雷斯包括这在他的书中Laravel第一章:https://web.archive.org/web/20121013083457/http://daylerees.com/2012/03/25/laravel-getting-started/

You need to create a virtualhost. Dayle Ress covers this in the first chapter in his Laravel book: https://web.archive.org/web/20121013083457/http://daylerees.com/2012/03/25/laravel-getting-started/

这篇关于Laravel(和通用)的框架设置[公开&QUOT;夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 02:35