vendredi 27 octobre 2017

Apache re-direct from HTTP to HTTPS

All, I'm having a issues with redirecting from http to https. My site comes up without any issue when you use either protocol. But my redirect will never work. I'm using Ubuntu 17.04 and Apache 2.4.25. I have executed sudo a2enmod rewrite and have restarted apache via sudo restart apache2.

In addition, I have created an .htaccess in the root of the directory that my index.html exists. The contents of my .htaccess file is below. Is there anything wrong with the syntax or how I'm trying to enable redirect on my ubuntu server? Thanks for any help!

NameVirtualHost *:80

DocumentRoot /var/www/html # the final correct redirect RewriteEngine on RewriteCond %{HTTP:X-Forwarded-Proto} =http RewriteRule . https://www.abcdef.com [L,R=permanent]




Aucun commentaire:

Enregistrer un commentaire