我的modrewrites努力通过
haha.domain.com
到domain.com/master5.php?userid=haha
但是我无法将子域传递给更多的控制器
haha.domain.com/33/44
到domain.com/master5.php?userid=haha&pid=33&wid=44
这是我的代码:
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.domain\.com$ [NC]
RewriteRule ^$ http://www.domain.com/profile.php?username=%2 [L]
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)$ http://www.domain.com/master5.php?username=%2&$1&$2 [L]
RewriteRule ^([a-zA-Z0-9]+)/([a-zA-Z0-9]+)/$ http://www.domain.com/master5.php?username=%2&$1&$2 [L]
答案 0 :(得分:2)
尝试将QSA(查询字符串追加)添加到RewriteRules:[L,QSA]
。