1、多站点配置找到apache下面的 conf/httpd.conf
# Virtual hosts
Include conf/extra/httpd-vhosts.conf //将这句前面的#号注释掉
2、找到conf/extra/httpd-vhosts.conf
<VirtualHost 127.0.0.1:80>
DocumentRoot "d:/wamp/www/testadmin/"
ServerName www.test.com
</VirtualHost>
添加以上配置,保存之后重启Apache
3、到drivers/etc/ 打开hosts,添加如下配置
127.0.0.1 www.test.com
4、之后就可以用以上自定义域名访问到你的本地站点了!
配置本地Apache服务器的时候,加入.htaccess文件之后出现以下错误
nternal Server ErrorThe server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log. 有两种解决方案
解决1:1. 打开 httpd.conf2.找到 mod_rewrite.so 行,将前面的注释打开(即删掉前面的‘#‘符号)。3.关闭httpd.conf,重启apache服务器即可。 解决2:httpd.conf 中找到你网站目录对应的Directory 行,将其中的 RewriteEngine 项设置为 ‘ALL‘。
时间: 2024-10-08 15:10:51