Linode ip is redirected to subdomain

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

4 Replies

Your DNS is great and checks out! Would you be able to post your Apache config? I can take a look for you :)

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.

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

Aestesi, Vance,

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

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

To prevent Google from complaining for SEO.

Grtz

Willem

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct