【发布时间】:2016-11-15 00:05:54
【问题描述】:
我已经在我的 lumen 的公共文件夹中使用 .htaccess 文件尝试了几乎所有可能的选项,但它们都没有给我漂亮的 URL。
在以前的 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>
有什么想法吗?!
【问题讨论】: