in reply to Re^3: (OT) mod_rewrite anyone?
in thread (OT) mod_rewrite anyone?

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.

Replies are listed 'Best First'.
Re^5: (OT) mod_rewrite anyone?
by moritz (Cardinal) on Sep 26, 2009 at 15:39 UTC
    With actual rules http://www.subX.dom.com is redirected to http://subX.dom.com,

    With the rule I proposed? Somehow I have a very hard time believing that, since my rule never shortens an URL.

    Are you sure you actually tested it? And that you didn't use a browser to test it, but a tool like wget?

    (Browsers cache permanent redirects, so they are not very useful for debugging them).

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