laravel 框架的问题:无法去掉index.php

帖子列表 发布于 2013/04/10 09:37
阅读 4K+
收藏 0

I checked the docs, but could not figured it out where the problem occured, here is my configuration and environment:

Ubuntu 12.04.2 LTS
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:34:31)

/etc/hosts

127.0.0.1       localhost
127.0.0.2       truelove
127.0.1.1       hp1000

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/etc/apache2/conf.d/vhost.conf

<VirtualHost 127.0.0.2>
    ServerAdmin test@gmail.com
    ServerName truelove
    DocumentRoot /var/www/truelove/public
    ErrorLog /var/www/truelove.error.log
    CustomLog /var/www/truelove.access.log combined

    <Directory "/var/www/truelove/public">
    allow from all
    AllowOverride all
    Options Indexes FollowSymLinks MultiViews
    </Directory>
</VirtualHost>

/var/www/truelove/public/.htaccess

<IfModule mod_rewrite.c>
	Options +FollowSymLinks
	RewriteEngine On
</IfModule>

# For all files not found in the file system, reroute the request to the
# "index.php" front controller, keeping the query string intact

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
 
RewriteRule . index.php [L]
</IfModule>

Now, when I visit : http://truelove , I can see the default welcome page of laravel framework. but, when I click the document link or visit http://truelove/docs/ , then not found. I could only view by http://truelove/index.php/docs

I forgot to paste out my config/application.php
	'url' => 'http://truelove',
	'index' => '',
加载中
0
开源中国第一渣男
开源中国第一渣男
  RewriteRule .* index.php [L]
帖子列表
帖子列表
Bl大哥 我这样写还是不对
0
我不叫大脸猫
我不叫大脸猫
标题用中文,内容用英文,这是什么节奏
0
_cooper
_cooper

application/config/application.php 

'index' => 'index.php', 改为 'index' => '',

/*
|--------------------------------------------------------------------------
| Application Index
|--------------------------------------------------------------------------
|
| If you are including the "index.php" in your URLs, you can ignore this.
| However, if you are using mod_rewrite to get cleaner URLs, just set
| this option to an empty string and we'll take care of the rest.
|
*/


帖子列表
帖子列表
如果你看问题的话,会发现我已经去掉了index.php,但还是谢谢!这个问题已经解决了。原因在于apache没有加载rewrite模块。看到你也在用laravel,欢迎一起来交流:16406911 (qq群)
返回顶部
顶部