用.htaccess实现二级域名功能

.htaccess设置以下:
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^www.aoyou0898.com$
RewriteCond %{REQUEST_URI} !^/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /$1
RewriteCond %{HTTP_HOST} ^www.aoyou0898.com$
RewriteRule ^(/)?$ /index.php [L]
#主站的伪静态写在以下
#主站的伪静态写在以上
RewriteCond %{HTTP_HOST} ^qxc.aoyou0898.com$
RewriteCond %{REQUEST_URI} !^/qxc/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /qxc/$1
RewriteCond %{HTTP_HOST} ^qxc.aoyou0898.com$
RewriteRule ^(/)?$ qxc/index.php [L]


工作中用到的记录一下

你可能感兴趣的:(工作分享)