appache:
<VirtualHost *:80>
ServerName my.hunmenghui.com
ServerAlias *.936880.com
DocumentRoot "F:\wwwroot\wechat\git-wechat"
<Directory "F:\wwwroot\wechat\git-wechat">
AllowOverride All
Options None
Order allow,deny
Allow from all
</Directory>
rewriteengine on
rewritecond %{HTTP_HOST} [^.]+\.936880\.com$
RewriteCond %{REQUEST_FILENAME} !^.*\.(gif|jpg|jpeg|png|swf|css|js)$
rewriterule ^(.+) %{HTTP_HOST}$1 [C]
rewriterule ([^.]+)\.936880\.com(.*) /index\.php?q=microsite/home&domain=$1[QSA,L]
</VirtualHost>
nginx:
server_name 936880.com *.936880.com;
root /home/www-data/public_html/936880.com;
set $my_rewt "";
if ($host ~* ^(.+)\.936880\.com$ ) {
set $my_rewt $1;
}
if ($host ~* my.936880.com) {
set $my_rewt "";
}
if ($request_filename ~* ^(.*)\.(jpg|jpeg|gif|png|swf|rar|zip|css|js)$) {
set $my_rewt "";
}
if ($my_rewt != "") {
rewrite ^\/$ /index.php?q=microsite/home&domain=$my_rewt last;
}