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是在标签之内的那个。“~”为Apache的安装目录
在入口文件目录加入.htaccess文件,(如果.htaccess文件创建不了,可以到网上下一个)文件中写入重写规则。
| 代码如下 | 复制代码 |
| RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] |
|
我的PHP项目的入口文件是index.php
最后重启Apache服务器
韩剧再婚皇后阿里云盘全集高清1080P资源链接-韩剧再婚皇后免费阿里云盘资源下载4K高清无删减版链接
poipiku网站如何打开-poipiku官网网页版访问入口
明日方舟:终末地-云游戏畅玩入口-明日方舟:终末地-网页版在线直连地址
poki在线小游戏网页版-poki免费游戏大全入口
poki游戏入口-点开即玩-poki游戏-在线免费畅玩
原神akt大佬资源viciNeko入口链接-原神akt大佬资源网页vicineko入口链接分享