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

乌版图怎么去掉index.php

2025/6/17 4:48:32发布25次查看
乌版图去掉index.php的方法:1、在项目根目录创建“.htaceess”文件;2、复制“000-dedault.conf”文件并重命名;3、创建配置文件;4、开启apache2的更新模块;5、重启apache2即可。
本文操作环境:ubuntu 16.04系统、php7.1版,dell g3电脑
乌版图怎么去掉index.php?
ubuntu 16.04 本地 php 项目访问地址移除 index.php
1.在项目跟目录创建.htaceess文件,内容如下:
rewriteengine onrewritecond %{request_filename} !-drewritecond %{request_filename} !-frewriterule ^(.*)$ index.php/$1 [qsa,pt,l]
2.在/etc/apache2/site-avalible文件夹中复制000-dedault.conf文件,重命名为你的项目.conf,如下:
cp 000-default.conf mysite.conf
并增加以下内容:
<virtualhost *:80> servername www.mysite.com serveradmin webmaster@localhost documentroot /home/www/mysite <directory /home/www/mysite> options indexes followsymlinks allowoverride all require all granted order allow,deny allow from all </directory></virtualhost>
3.创建配置文件连接,把新建的配置文件激活什么东西巴拉巴拉(当前目录站点-可用)
sudo a2ensite mysite.conf
4.运行以下命令,开启apache2的更新模块
sudo a2enmod rewrite [重要]
5.重启apache2
systemctl restart apache2.service
【推荐学习:php视频教程】
以上就是乌版图怎么去掉index.php的详细内容。
该用户其它信息

VIP推荐

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