用了框架开发的时候,一般Apache都会加类似这段的规则实现单一入口
RewriteCond %{REQUEST_URI} !^.*(\.html|.xml|\.css|\.js|\.gif|\.png|\.jpg|\.swf|\.jpeg|\.doc|\.rar|\.ico)$
RewriteRule ^(/.*)$ /index.php现在想实现2级域名,就是当域名泛解析到这个目录的时候
xxx.demo.com/xid/18
能对应真实地址http://xxx.demo.com/xxx/xid/18
aaa.demo.com/aid/i8
能对应真实地址http://xxx.demo.com/aaa/adi/18求教应该如何修改 Rewrite规则?
RewriteCond %{REQUEST_URI} !^.*(\.html|.xml|\.css|\.js|\.gif|\.png|\.jpg|\.swf|\.jpeg|\.doc|\.rar|\.ico)$
RewriteRule ^(/.*)$ /index.php现在想实现2级域名,就是当域名泛解析到这个目录的时候
xxx.demo.com/xid/18
能对应真实地址http://xxx.demo.com/xxx/xid/18
aaa.demo.com/aid/i8
能对应真实地址http://xxx.demo.com/aaa/adi/18求教应该如何修改 Rewrite规则?
DocumentRoot "/opt/apache/htdocs/xxx"
ServerName xxx.demo.com
</VirtualHost><VirtualHost aaa.demo.com>
DocumentRoot "/opt/apache/htdocs/aaa"
ServerName aaa.demo.com
</VirtualHost