没有.htaccess文件正在与Laravel Lumen 5.2一起使用

时间:2016-07-12 16:13:19

标签: .htaccess laravel lumen

我已经在我的流明公共文件夹中尝试了.htaccess文件几乎所有可能的选项,但是他们没有给我漂亮的网址。

在Lumen的早期版本中,我没有触及任何.htaccess规则,但是所有的一切都与发布的默认.htaccess文件完美配合。 但是在这个新版本5.2中似乎没有任何效果。

默认值如下:

# Apache configuration file
# http://httpd.apache.org/docs/2.2/mod/quickreference.html

# Note: ".htaccess" files are an overhead for each request. This logic     should
# be placed in your Apache config whenever possible.
# http://httpd.apache.org/docs/2.2/howto/htaccess.html

# Turning on the rewrite engine is necessary for the following rules and
# features. "+FollowSymLinks" must be enabled for this to work symbolically.

<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>
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

有什么想法吗?!

1 个答案:

答案 0 :(得分:0)

在您的apache配置文件(httpd.conf或apache2.conf)中,您必须将“AllowOverride”更改为“All”:

<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>