| Linode Forum https://forum.linode.com/ |
|
| Linode ip is redirected to subdomain https://forum.linode.com/viewtopic.php?f=19&t=12248 |
Page 1 of 1 |
| Author: | willemdh [ Tue Sep 08, 2015 3:45 pm ] |
| Post subject: | 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 |
|
| Author: | Aestesi [ Tue Sep 08, 2015 5:24 pm ] |
| Post subject: | Re: Linode ip is redirected to subdomain |
Your DNS is great and checks out! Would you be able to post your Apache config? I can take a look for you |
|
| Author: | Vance [ Wed Sep 09, 2015 1:37 am ] |
| Post subject: | Re: Linode ip is redirected to subdomain |
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. |
|
| Author: | Aestesi [ Wed Sep 09, 2015 4:17 am ] |
| Post subject: | Re: Linode ip is redirected to subdomain |
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 |
|
| Author: | willemdh [ Wed Sep 09, 2015 5:14 pm ] |
| Post subject: | Re: Linode ip is redirected to subdomain |
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\.84To prevent Google from complaining for SEO. Grtz Willem |
|
| Page 1 of 1 | All times are UTC-04:00 |
| Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |
|