Thread: www redirect?
View Single Post
  #5  
Old 12th August 2008, 19:40
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 143
Thanks: 48
Thanked 7 Times in 5 Posts
Default

Code:
<VirtualHost <myip>:80>
ServerName www.domain2.com:80
ServerAdmin webmaster@domain2.com
DocumentRoot /var/www/web16/web
ServerAlias www.domain2.com domain2.com
DirectoryIndex index.html index.htm index.php index.php5 index.php4 index.php3 index.shtml index.cgi index.pl index.jsp Default.htm default.htm
ErrorLog /var/www/web16/log/error.log
Alias /error/ "/var/www/web16/web/error/"
ErrorDocument 400 /error/invalidSyntax.html
ErrorDocument 401 /error/authorizationRequired.html
ErrorDocument 403 /error/forbidden.html
ErrorDocument 404 /error/fileNotFound.html
ErrorDocument 405 /error/methodNotAllowed.html
ErrorDocument 500 /error/internalServerError.html
ErrorDocument 503 /error/overloaded.html
AliasMatch ^/~([^/]+)(/(.*))? /var/www/web16/user/$1/web/$3
AliasMatch ^/users/([^/]+)(/(.*))? /var/www/web16/user/$1/web/$3
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^domain2\.com [NC]
RewriteRule ^/(.*)         http://www.domain.com/$1 [L,R]
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
  RewriteRule .* - [F]
</IfModule>
</VirtualHost>
I also tried adding a co-domain for host "www" but then I get an error something like "already in use"
Reply With Quote