dimanche 23 septembre 2018

redirect from www to https

I have already configured https on my site. While http redirects to https www does not. The conf file is setup as:

<VirtualHost *:80>
    ServerAdmin admin@example.site
    ServerName example.site
    ServerAlias www.example.site
    DocumentRoot /var/www/example.site/html
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.example.site [OR]
RewriteCond %{SERVER_NAME} =example.site
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

Under https / http users arrive at my site but under www then end up at the domain name providers "under construction" page. Is there something amiss with the RewriteCond? Any pointers would be much appreciated!




Aucun commentaire:

Enregistrer un commentaire