Redirectionare website spre HTTPS

Redirectionare website spre HTTPS

  1. Activarea redirectionarii permanente prin modificarea fisierului de configurare al virtual host
    <VirtualHost *:80> 
    ServerName www.lorand.work
    Redirect permanent / https://www.lorand.work/
    </VirtualHost>
    
    <VirtualHost _default_:443> 
    ServerName www.lorand.work
    DocumentRoot /var/www/httpdocs
    SSLEngine On 
    </VirtualHost>
  2. Activarea redirectionarii folosind fisierul .htaccess
    RewriteEngine On 
    RewriteCond %{HTTPS} !=on 
    RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]

Leave a Reply

Your email address will not be published. Required fields are marked *