.htaccess - Is possible make subdomains with wildcards without redirect (R flag)? -
i think have configured ok wildcards in domain, because works me:
rewritecond %{http_host} !^www\.example\.com [nc] rewritecond %{http_host} ^([^.]+)\.example\.com rewriterule ^(.*)$ http://www.example.com/member.php?username=%1 [r,l]
but if redirect r or r=301 flag. have virtual subdomain, , user don't notice it. subdomain.example.com , don't change url in bar.
i have tried next:
rewritecond %{http_host} !^www\.example\.com [nc] rewritecond %{http_host} ^([^.]+)\.example\.com rewriterule ^(.*)$ http://www.example.com/member.php?username=%1 [l]
without r flag. internal server error. problem? me please?
you can't redirect absolute url without redirect.
"virtual user host" section in document solves problem.
if user.example.com , www.example.com pointing same machine then
rewritecond %{http_host} !^www.example.com [nc] rewritecond %{http_host} ^([^.]+).example.com rewriterule ^(.*)$ /member.php?username=%1 [l]
but planning group captured in rewriterule
Comments
Post a Comment