开发者

.htaccess variable not passover

开发者 https://www.devze.com 2023-02-10 20:05 出处:网络
I the modrewrites to work to pass haha.domain.com to domain.com/master5.php?userid=haha but I cannot pass the subdomain to more controllers like

I the modrewrites to work to pass haha.domain.com to domain.com/master5.php?userid=haha

but I cannot pass the subdomain to more controllers like haha.domain.com/33/44 to doma开发者_StackOverflow社区in.com/master5.php?userid=haha&pid=33&wid=44

here's my code below:

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]


Try adding QSA (Query String Append) to the RewriteRules: [L,QSA].

0

精彩评论

暂无评论...
验证码 换一张
取 消