Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Apache2 doesnt redirect non-www to www

I have a apache2 serving an application which works fine on www.domain.co.uk but when going to domain.co.uk (non www) it doesn't redirect the traffic. I added a redirect to my .conf file and it still doesn't work. See below:

<VirtualHost *:80>
    ServerName domain.co.uk
    Redirect permanent / http://www.domain.co.uk/
</VirtualHost>
<VirtualHost *:80>
    ServerName www.domain.co.uk
    ServerAlias domain.co.uk
    # Actual server configuration
</VirtualHost>

Does anyone know how to redirect the non-www traffic to www (or fix my configuration!)?

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You have two separate areas of the configuration capturing domain.co.uk - one is in the redirection, the other (through your use of ServerAlias) in the configuration that serves the content. The second capture is overriding the first.

To resolve the issue, simply remove the line:

ServerAlias domain.co.uk

and restart Apache.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda