Committer: gariev
LJSUP-8384: If user types "www.username.livejournal.com" we should open "username.livejournal.com"U trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm =================================================================== --- trunk/cgi-bin/Apache/LiveJournal.pm 2011-03-25 11:48:26 UTC (rev 18714) +++ trunk/cgi-bin/Apache/LiveJournal.pm 2011-03-28 04:51:00 UTC (rev 18715) @@ -838,7 +838,13 @@ # Akamai and other CDN networks...) my $skip_domain_checks = 0; - # user domains + ## special case: + ## www.test.livejournal.com --(redirect)--> test.livejournal.com + if ($host =~ /^w{1,4}.([\w\-]{1,15})\.\Q$LJ::USER_DOMAIN\E$/) { + return redir("http://$1.$LJ::USER_DOMAIN$uri$args_wq"); + } + + # user domains: if (($LJ::USER_VHOSTS || $LJ::ONLY_USER_VHOSTS) && $host =~ /^([\w\-]{1,15})\.\Q$LJ::USER_DOMAIN\E$/ && $1 ne "www" &&