P is for Practical | |
PerlMonks |
(OT) mod_rewrite anyone?by mrc (Sexton) |
on Sep 26, 2009 at 10:57 UTC ( [id://797673]=perlquestion: print w/replies, xml ) | Need Help?? |
mrc has asked for the wisdom of the Perl Monks concerning the following question:
I'm using mod_rewrite to virtually map to a local path.
path: /home/user/subdomain.domain.com/ Rules: RewriteCond %{HTTP_HOST} \.([^.]+\.[^.]+\.[^.]+)$ will redirect http://www.subdomain.domain.com to http://subdomain.domain.com, but I want the reverse. http://subdomain.domain.com redirected to http://www.subdomain.domain.com and 'www' url to remain unchanged. Changing the rule to RewriteRule ^(.*) http://www\.%1$1 [R,L] will broke entire configuration. I have also tried to modify RewriteCond %{HTTP_HOST} \.([^.]+\.[^.]+\.[^.]+)$ in many ways, but I don't know how to solve it. Any help would be greatly appreciated. Thank you!!
Back to
Seekers of Perl Wisdom
|
|