| 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 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 0 | ▶ | use Apache::Constants qw(OK); |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 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__ | ||