Apache Redirection

From Ilianko
Revision as of 15:20, 13 October 2013 by Anko (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Активиране на модул:

a2enmod rewrite

Да се редактират настройките на web директорията. За default директорията

файлът:
:~$ nano /etc/apache2/sites-enabled/000-default

ot:

<VirtualHost *:80>
       ServerAdmin contact@yourwebsite.com

       DocumentRoot /var/www/public

       <Directory />
...
</VirtualHost>

Да стане:

 <VirtualHost *:80>
        RewriteEngine on
        ReWriteCond %{SERVER_PORT} !^443$
        RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
 </VirtualHost>