Difference between revisions of "Apache Redirection"
From Ilianko
(Created page with "Да се редактират настройките на web директорията. За default директорията файлът: :~$ nano /etc/apache2/sites-enable...") |
|||
Line 13: | Line 13: | ||
</VirtualHost> | </VirtualHost> | ||
Да стане: | Да стане: | ||
− | <VirtualHost *:80> | + | <VirtualHost *:80> |
RewriteEngine on | RewriteEngine on | ||
ReWriteCond %{SERVER_PORT} !^443$ | ReWriteCond %{SERVER_PORT} !^443$ | ||
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L] | ||
</VirtualHost> | </VirtualHost> |
Revision as of 15:08, 13 October 2013
Да се редактират настройките на 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>