需要使用二级域名作为用户访问的参数一部分的,经常用在blog等注册用户的个性域名中。
看了很多朋友写的规则,似乎对www都没有做处理,请注意第二行,排出www这个域名的访问跳转,否则,首页也做了跳转了。
<pre class="brush:plain;"> RewriteCond %{HTTP_HOST} ^[a-z0-9\-]+\.f\.com\.au$ [NC]
RewriteCond %{HTTP_HOST} !^www\.f\.com\.au$ [NC]
RewriteRule ^/?$ /%{HTTP_HOST}
RewriteRule ^/([a-z0-9\-]+)\.f\.com\.au/?$ http://www.p.com.au/index.php?domain=$1 [L]
```
二级域名 apache rewrite 重写 地址 地址 参数 www