Apache 设置二级域名
Posted seliote
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Apache 设置二级域名相关的知识,希望对你有一定的参考价值。
开启重写模块
LoadModule rewrite_module modules/mod_rewrite.so
编辑配置
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/var/www/html"
ServerName $DOMAIN_NAME
ErrorLog "logs/error_log"
CustomLog "logs/access_log" combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/$DIR"
ServerName $PREFIX.$DOMAIN_NAME
ErrorLog "logs/error_log"
CustomLog "logs/access_log" combined
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/var/www/html/$ANOTHER_DIR"
ServerName $ANOTHER_PREFIX.$DOMAIN_NAME
ErrorLog "logs/error_log"
CustomLog "logs/access_log" combined
</VirtualHost>
以上是关于Apache 设置二级域名的主要内容,如果未能解决你的问题,请参考以下文章