您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

laravel隐藏index.php的方法

2025/10/24 14:04:35发布10次查看
laravel隐藏index.php的方法:1、开启apache mod_rewrite模块,并修改htaccess文件;2、在nginx配置文件中通过“try_files $uri $uri/...”指令实现隐藏index.php。
本文操作环境:windows7系统、laravel5.7版,dell g3电脑
laravel 配置 隐藏index.php
apache
首先保证你的apache mod_rewrite 模块已经开启. 框架默认有一个 public/.htaccess 文件可以实现隐藏 index.php 的访问.
如果无效的话,可以试试下面的规则:
options +followsymlinksrewriteengine onrewritecond %{request_filename} !-drewritecond %{request_filename} !-frewriterule ^ index.php [l]
nginx
在nginx配置文件中通过下面的指令实现隐藏 index.php:
location / { try_files $uri $uri/ /index.php?$query_string;}
相关推荐:最新的五个laravel视频教程
以上就是laravel隐藏index.php的方法的详细内容。
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product