【发布时间】:2014-11-29 22:59:48
【问题描述】:
我的 ubuntu 服务器上有 apache2。
有我的 /etc/apache2/sites-available/laravel.conf
<VirtualHost *:80>
ServerName http://laravel.mysite.com/
DocumentRoot "/var/www/laravel/public"
<Directory "/var/www/laravel/public">
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
我已经打开了 apache 的 mod_rewrite 函数。
有我的 /var/www/laravel/app/routes.php
<?php
Route::get('/', function()
{
return View::make('home/index');
});
Route::get('/hehe', function()
{
return "hehe';
});
有我的 /var/www/laravel/public/.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes...
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
现在,我可以访问http://laravel.mysite.com,但是当我访问http://laravel.mysite.com/hehe 时,它会出现404 错误。是不是我配置错了?
【问题讨论】: