jeudi 5 octobre 2017

ServerAlias not redirecting

I have an Apache vhost setup to host my website from. I have a developer subdomain for testing. The main domain and the developer domain are defined in two separate vhosts, in the same configuration file.

I have a vhost setup to redirect domain1.co.uk, www.domain2.uk and domain2.uk to www.domain1.co.uk.

I also have another vhost for my developer subdomain. It is setup to redirect http://ift.tt/2y4OlZD,www.dev.domain2.ukanddev.domain2.uktodev.domain1.co.uk`.

The first vhost works properly, redirecting all 3 domains to my main domain, however the second vhost's ServerAliases don't work. When I try to connect to them, they just timeout.

This is my conf file...

<VirtualHost *:80>  
  ServerName www.domain1.co.uk
</VirtualHost>

<VirtualHost *:80>
  ServerName domain1.co.uk

  ServerAlias domain2.uk
  ServerAlias www.domain2.uk

  Redirect / http://ift.tt/2eOWWTZ
</VirtualHost>

<VirtualHost *:80>  
  ServerName dev.domain1.co.uk
</VirtualHost>

<VirtualHost *:80>
  #This ServerName works, when I connect to this one, it redirects properly.
  ServerName http://ift.tt/2y4OlZD

  #These are the ServerAlias sections that don't work.
  ServerAlias dev.domain2.uk
  ServerAlias www.dev.domain2.uk

  Redirect / http://ift.tt/2y2q3iH
</VirtualHost>

Am I missing something or is there something wrong with Apache?

I know this is complicated and hard to comprehend, leave a comment if you need more explanation.

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire