.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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -