最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Apache配置虚拟主机及开启rewrite模式
时间:2022-06-25 00:13:03 编辑:袖梨 来源:一聚教程网
Apache配置虚拟主机
修改httpd.conf
启用Virtual hosts
#Include conf/extra/httpd-vhosts.conf (查找这行,把前面的#去掉)
注释 DocumentRoot "D:/Program Files/Apache/Apache2.2/htdocs"
注释
#
# Options FollowSymLinks
# AllowOverride None
# Order deny,allow
# Allow from all
#
配置 /conf/extra/httpd-vhosts.conf
| 代码如下 | 复制代码 |
ServerAdmin [email protected] # 管理员邮箱 ServerName xxx.xx.com # 绑定的域名 DocumentRoot "d:/www/wordpress" # 网站目录 ServerAlias xxx.xxx.cn #网站别名,可以不设置 ErrorLog "logs/dummy-host.localhost-error.log" #日志 CustomLog "logs/dummy-host.localhost-access.log" common |
|
Apache开启rewrite模式
打开Apache配置文件:Apache安装目录/conf/httpd.conf。
搜索rewrite:会找到"#LoadModule rewrite_module modules/mod_rewrite.so",将前面的“#”去掉。
搜索AllowOverride:将"AllowOverride none"改成"AllowOverride all"。注意:这个AllowOverride是在
在入口文件目录加入.htaccess文件,(如果.htaccess文件创建不了,可以到网上下一个)文件中写入重写规则。
| 代码如下 | 复制代码 |
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] |
|
我的PHP项目的入口文件是index.php
最后重启Apache服务器
相关文章
- 新三国志曹操传马超无双试炼四通关攻略 12-15
- 俄罗斯YANDEX引擎官网入口-免登录直达Yandex首页 12-15
- 漫蛙ManWa在线免费阅读入口_漫蛙ManWa官方网页版一键直达 12-15
- 逃离鸭科夫仓库区地窖在哪 仓库区地窖入口位置详情 12-15
- 光与影33号远征队熙艾尔bd玩法:熙艾尔毕业装备与加点思路介绍 12-15
- 漫蛙网页版免费入口进不去-漫蛙网页版最新免费版一键直达 12-15