#1  
Old 10th August 2008, 11:30
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default www redirect?

Hi,

I added a domain domain.com

I want to redirect domain.com and www.domain.com to www.domain2.com

domain.com I setup the redirect and is working.
www.domain.com shows me the default welcomepage (no index.html)

how to fix the www to redirect also?
Reply With Quote
Sponsored Links
  #2  
Old 11th August 2008, 10:15
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
Default

add www.domain2.com as co-domain to the website www.domain.com
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 11th August 2008, 16:40
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

well if domain.com was on my server it was no problem. It is hosted somewhere else.
Reply With Quote
  #4  
Old 12th August 2008, 19:14
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Canyou post the vhost configuration of that vhost from Vhosts_ispconfig.conf?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 12th August 2008, 19:40
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
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
  #6  
Old 13th August 2008, 16:58
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Put this in the Apache Directives field in ISPConfig:

Code:
RewriteEngine on
RewriteCond %{HTTP_HOST}   ^www\.domain2\.com [NC]
RewriteRule ^/(.*)         http://www.domain.com/$1 [L,R]
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
commentator (13th August 2008)
  #7  
Old 13th August 2008, 21:07
commentator commentator is offline
Senior Member
 
Join Date: Jul 2008
Location: The Netherlands
Posts: 146
Thanks: 49
Thanked 7 Times in 5 Posts
Default

thanks, thats working

why is it not working by default if I setup a redirect for a domain?
Reply With Quote
  #8  
Old 13th August 2008, 21:12
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
 
Default

It is working fine when you use the default redirect. The only difference is that the domain changes when you use the default redirect function and if you use the rule that falko posted above, the domain in the browser bar dioes not change to the target domain.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Wordpress based web page after installing Ispconfig Mole Installation/Configuration 50 9th May 2008 10:07
my postfix don't ready or other problem pierremoreau Installation/Configuration 2 1st September 2006 09:44
Perfect Setup Suse 10 can send but not receive mail Grizzly HOWTO-Related Questions 33 6th March 2006 23:14
Problem recieving mail webstergd Installation/Configuration 19 16th December 2005 12:08
webmail and pop3 quicklinux General 8 9th August 2005 00:15


All times are GMT +2. The time now is 14:13.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.