in reply to (OT) mod_rewrite anyone?

Maybe
RewriteCond %{HTTP_HOST} !^www RewriteRule ^(.*) http://www.%{HTTP_HOST}$1 [R,L]

(Don't know if you can interpolate these variables in URLs)

Perl 6 - links to (nearly) everything that is Perl 6.

Replies are listed 'Best First'.
Re^2: (OT) mod_rewrite anyone?
by mrc (Sexton) on Sep 26, 2009 at 14:11 UTC
    Not working, sadly.
      It would help if you were more specific.
      Perl 6 - links to (nearly) everything that is Perl 6.
        Subdomains are located under
        /home/user/sub1.dom.com
        /home/user/sub2.dom.com
        /home/user/sub3.dom.com
        and so on.
        With actual rules
        http://www.subX.dom.com is redirected to http://subX.dom.com, but I want
        http://www.subX.dom.com to http://www.subX.dom.com and
        http://subX.dom.com to http://www.subX.dom.com
        In my first example, RewriteRule ^(.*) http://%1$1 [R,L] working, but RewriteRule ^(.*) http://www.%1$1 [R,L] no longer.