.htaccess 否。htaccess文件正在使用Laravel Lumen 5.2

.htaccess 否。htaccess文件正在使用Laravel Lumen 5.2,.htaccess,laravel,lumen,.htaccess,Laravel,Lumen,我在lumen的公用文件夹中尝试了几乎所有可能的.htaccess文件选项,但没有一个给了我漂亮的URL 在Lumen的早期版本中,我没有触及任何.htaccess规则,但所有的东西都可以完美地与附带的default.htaccess文件配合使用。 但在这个新版本5.2中,似乎什么都不起作用 默认设置如下所示: # Apache configuration file # http://httpd.apache.org/docs/2.2/mod/quickreference.html # Not

我在lumen的公用文件夹中尝试了几乎所有可能的.htaccess文件选项,但没有一个给了我漂亮的URL

在Lumen的早期版本中,我没有触及任何.htaccess规则,但所有的东西都可以完美地与附带的default.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>
#Apache配置文件
# http://httpd.apache.org/docs/2.2/mod/quickreference.html
#注意:“.htaccess”文件是每个请求的开销。这种逻辑应该是正确的
#只要有可能,请将其放置在Apache配置中。
# http://httpd.apache.org/docs/2.2/howto/htaccess.html
#打开重写引擎对于以下规则和操作是必要的
#特征。必须启用“+FollowSymLinks”才能使其象征性地工作。
选项+FollowSymLinks
重新启动发动机
#对于文件系统中未找到的所有文件,请将请求重新路由到
#“index.php”前端控制器,保持查询字符串完整
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
有什么想法吗

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


选项如下符号链接
允许超越所有
<Directory />
    Options FollowSymLinks
    AllowOverride All
</Directory>