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

367
Vistas
Hostname SNI/HTTP mismatch for www.example.com but not example.com

I've had a look at this question, but none of the answers seem to apply. The errors aren't being generated by bots or deliberate attempts to test vulnerabilities - if I enter www.example.com in my browser's address bar (tested on multiple browsers), I will receive a Bad Request error, and the following error will be present in my log for that time:

Hostname example.com provided via SNI and hostname www.example.com provided via HTTP are different

There are also no subdomains that would be causing the underscore issue mentioned in another answer.

I've attempted to add the following lines in my sites-available configuration file in the VirtualHost, but it didn't seem to have any effect:

ServerName example.com
ServerAlias www.example.com

The SSL certificate is from LetsEncrypt, currently valid, and the SANs appear to be correctly listed as www.example.com and example.com.

I've never seen an issue like this before, so I'm not even sure what other information might be relevant to the question.

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

0

if I enter www.example.com in my browser's address bar (tested on multiple browsers), I will receive a Bad Request error, and the following error will be present in my log for that time:

To make things clean, and to follow the general drifting away from www use on the Internet, I use this configuration in Apache, it will cause a redirect back to the https://example.com every time, making that the canonical domain part of the URL, which makes Google Webmaster Tools and Google Analytics happy.

Two virtual host files:

example.com.conf:

<VirtualHost *:80>

    ServerName example.com
    DocumentRoot /var/www/example.com/public

..

www.example.com.conf:

<VirtualHost *:80>
    ServerName www.example.com

    Redirect permanent / https://example.com/
    CustomLog ${APACHE_LOG_DIR}/access_example.log vhost_combined

</VirtualHost>

On Apache to start up the website:

a2ensite example.com
a2ensite www.example.com
service apache2 reload

Install the Let's Encrypt certificates:

letsencrypt --apache -d example.com -d www.example.com

I have been running this configuration for years on 20+ live websites and only see the automatic redirect from the www.example.com to the example.com in the browser, so no errors.

But having said that, I monitor my logs closely and I see this:

Hostname example.com provided via SNI and hostname www.example.com provided via HTTP are different

It will come up randomly at random times on a subset of my websites. It appears to be the noise of the Internet, no real consequence.

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