apache下启用二级域名泛解析,实现博客功能
By admin
- One minute read - 52 wordshttpd_vhosts.conf文件内容
DocumentRoot “d:/site/papake.cn” DirectoryIndex index.htm index.php
Options Indexes MultiViews AllowOverride None order allow,deny Allow from all Options FollowSymLinks Includes
RewriteEngine on RewriteLog logs/re.log RewriteLogLevel 1 RewriteCond %{HTTP_HOST} ^[a-zA-Z0-9-]+.papake.cn$ RewriteCond %{HTTP_HOST} !^(www).papake.cn$ RewriteRule ^/?$ /%{HTTP_HOST} [NC] RewriteRule ^/([a-zA-Z0-9-]+).papake.cn/?$ http://www.papake.cn/$1 [P,L]
RewriteLog “D:/Apache2.2/logs/rewrite.log”
以上要实现输入lihai.papake.cn的网址,实现处理的是www.papake.cn/lihai此文件夹里的内容的,除了www这个以外.
需要启用的模块有:
LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_http_module modules/mod_proxy_http.so