server host name and server ip address redirect (Debian, Apache)

Posted by Matthias Reisner on Server Fault See other posts from Server Fault or by Matthias Reisner
Published on 2012-06-30T08:21:03Z Indexed on 2012/06/30 9:17 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

I have the following folder structure on my apache!

.../var/www/www.x.tt/htdocs

.../var/www/www.y.tt/htdocs

I have defined a virtual host for each.

So if I type in www.x.tt in my browser I get to the www.x.tt site. And the same for www.y.tt.

But now my question! If I type in the server address or the server host name I get to the ../var/www directory but I want that the user will be redirected to the www.x.tt site!

Do I have to create a new virtual host for this problem or is it also possible only to add a .htaccess Rule?!

Thanks!

© Server Fault or respective owner

Related posts about apache2

Related posts about debian