Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Sep 08, 2015 3:45 pm 
Offline
Senior Newbie

Joined: Mon Aug 10, 2015 12:07 pm
Posts: 5
Website: http://outsideit.net
Hello,

I've been trying to find out why my Linode server ip is redirected to a subdomain of my domain. So my domain is http://outsideit.net and my Linode ip is 212.71.234.84. When someone surfs to http://212.71.234.84 he arrives at http://ghent.outsideit.net

I have two corresponding A records.
one with an empty hostname, and 212.71.234.84 as IP
And another with
ghent as hostname and also 212.71.234.84 as IP.

What can I do to make surfing to my Linode IP 212.71.234.84 as IP effectively going to my domain root http://outsideit.net

Thanks for any advice around this.

Grtz.

Willem

_________________
http://outsideit.net


Top
   
PostPosted: Tue Sep 08, 2015 5:24 pm 
Offline
Newbie

Joined: Tue Sep 08, 2015 5:15 pm
Posts: 2
Your DNS is great and checks out! Would you be able to post your Apache config? I can take a look for you :)


Top
   
PostPosted: Wed Sep 09, 2015 1:37 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
I see you're using Apache on CentOS. With Apache, requests that don't specify a particular host (such as those for the IP address) are served by the "first" VirtualHost configuration. Files are read alphabetically and processed in order. If, for example, you have two files named outsideit.net.conf and ghent.outsideit.net.conf containing the VirtualHost configurations, then ghent.outsideit.net.conf comes first ("g" before "o"). You could force the other one to be first by renaming it something like 00.outsideit.net.conf and restarting Apache.

If both sites are configured in the same file, you need to move the VirtualHost you want to be first up to the top.


Top
   
PostPosted: Wed Sep 09, 2015 4:17 am 
Offline
Newbie

Joined: Tue Sep 08, 2015 5:15 pm
Posts: 2
In short, Lance is saying the first listed virtual host is the default virtual host.

Check out this doc which may be helpful to you:
http://httpd.apache.org/docs/2.2/vhosts/name-based.html


Top
   
PostPosted: Wed Sep 09, 2015 5:14 pm 
Offline
Senior Newbie

Joined: Mon Aug 10, 2015 12:07 pm
Posts: 5
Website: http://outsideit.net
Aestesi, Vance,

Thank you both very much for your answers. I got it working now and added a .htaccess rule

Code:
RewriteCond %{HTTP_HOST} ^212\.71\.234\.84
RewriteRule (.*) http://outsideit.net/$1 [R=301,L]


To prevent Google from complaining for SEO.

Grtz

Willem

_________________
http://outsideit.net


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group