【发布时间】:2015-05-12 08:13:04
【问题描述】:
/etc/apache2/apache2.conf
<Directory />
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride All
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
然后在我的 Laravel 公用文件夹中:
<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://sub.domain.se/user/login 不工作。
但是 http://sub.domain.se/index.php/user/login
有效。
写的时候:apachectl -M
rewrite_module(共享)被包括在内
在启用网站时:
<VirtualHost *:80>
ServerName sub.domain.se
DocumentRoot /var/www/project/public
</VirtualHost>
我错过了什么?
【问题讨论】:
-
已经重启你的apache服务器了吗?
-
是的,我已经尝试重启 Apache 服务器几次了。
标签: php apache .htaccess mod-rewrite