Laravel隐藏index.php的方法
laravel隐藏index.php的方法:1、开启Apache mod_rewrite模块,并修改htaccess文件;2、在Nginx配置文件中通过“try_files $uri $uri/...”指令实现隐藏index.php。
laravel 配置 隐藏index.php
Apache
首先保证你的Apache mod_rewrite 模块已经开启. 框架默认有一个 public/.htaccess 文件可以实现隐藏 index.php 的访问.
如果无效的话,可以试试下面的规则:
Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L]
Nginx
在Nginx配置文件中通过下面的指令实现隐藏 index.php:
location / { try_files $uri $uri/ /index.php?$query_string; }
2. 本站积分货币获取途径以及用途的解读,想在本站混的好,请务必认真阅读!
3. 本站强烈打击盗版/破解等有损他人权益和违法作为,请各位会员支持正版!
4. 建站教程 > Laravel隐藏index.php的方法