没有干净URL的Laravel和index.php

时间:2014-03-05 21:29:48

标签: php laravel-4 clean-urls

好的,我正在努力解决这个问题。我无法将清洁URL用于我的应用程序(抱怨),我正在使用Laravel 4.1构建在Windows服务器上运行。
我的登录页面给了我悲伤。它位于我的应用程序的根目录,https:\ localhost \ EPHY。登录表单上的URL通过

定义
{{ Form::open( array( 'url' => '/index.php/login', 'role'=>'form', 'class'=>'form-horizontal' ) ) }}

当我登录时,该URL将我带到https:\ localhost \ EPHY \ index.php \ main。 Groovy的。

我退出,触发Redirect::to('/'),我被分流回登录页面,但网址为https:\ localhost \ EPHY \ index.php。结果,当我再次登录时,我最终指向https:\ localhost \ EPHY \ index.php \ index.php \ main(注意doubled index.php)。

那么,我可以向Redirect :: to()提供什么,而不是静态URL(因为我有本地和生产环境的问题),它会将其发送回https:\ localhost \ EPHY而不是https :\本地主机\ EPHY \的index.php?我不能真正做一个绝对的URL,因为我有开发和生产环境。或者,我可以提供什么样的表单,以便在缺少时将index.php添加到操作中,但如果它存在则不会?

是的,我更愿意做干净的网址......

0 个答案:

没有答案