Apache Redirection

From Ilianko
Revision as of 15:08, 13 October 2013 by Anko (talk | contribs)

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

файлът:
:~$ nano /etc/apache2/sites-enables/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>