Press "Enter" to skip to content

Habilitando o redirect de http para https no Apache2 ( Atualizado )

Complementando o artigo anterior que descrevia como habilitar o SSL no Apache 2, agora apresento como habilitar o redirect de http para https no Apache 2, fazendo com que seu site funcione por padrão em modo seguro.

Habilite o mod_rewrite

a2enmod rewrite

OBS: Valeu Rodrigo!!!

Adicione as seguintes linhas no arquivo /etc/apache2/sites-available/default


CustomLog /var/log/apache2/access.log combined
ServerSignature On
RewriteEngine on
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R]
RewriteLog “/var/log/apache2/rewrite.log”
RewriteLogLevel 2

Fonte

3 Comments

  1. Rodrigo Belem Rodrigo Belem July 17, 2008

    No lugar do ln -s

    ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/

    pode ser usado o

    a2enmod rewrite

    Abraços

Comments are closed.