I was annoyed that when I set up a domain and gave it an alias that the
RewriteRule/Redirect that is default in the domain would not allow you
to visit the site by one of it's aliased names. So I wrote a patch. I
tried to think of a more elegant way to do this, but this works for me.
--- /usr/sausalito/perl/Base/Httpd.pm.orig 2007-03-18
07:06:33.000000000 -0400
+++ /usr/sausalito/perl/Base/Httpd.pm 2007-03-18 07:58:25.000000000 -0400
@@ -864,11 +864,31 @@
# ServerAlias lines
while (<$in>)
{
+
+ if (/^RewriteCond/)
+ {
+
+ if (/^.*# Alias$/)
+ {
+ next;
+ }
+ }
+
+ if (/^RewriteRule/)
+ {
+ for my $alias (@{$aliases})
+ {
+ print $out "RewriteCond %{HTTP_HOST}
!^$alias(:80)?\$ [NC] # Alias\n";
+ }
+ }
+
if (/^ServerAlias/)
{
next;
}
+
+
print $out $_;
}