line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: Hostname.pm,v 1.3 2004/06/24 18:28:37 nachbaur Exp $ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Apache::AxKit::StyleChooser::Hostname; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1152
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
6
|
1
|
|
|
1
|
|
2079
|
use Apache::Constants qw(OK); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.01; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub handler { |
10
|
|
|
|
|
|
|
my $r = shift; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
my $style = $r->hostname(); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
if ($style && $style ne $r->server->server_hostname()) { |
15
|
|
|
|
|
|
|
$style =~ s/^www\.//; # trim off useless "www" prefix |
16
|
|
|
|
|
|
|
$r->notes('preferred_style', $style); |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
return OK; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
1; |
22
|
|
|
|
|
|
|
__END__ |