htaccess redirect http pe https sub proxy sau nu

AlexH

Merg pe strada catre Mine...
Membru personal
Administrative
Freelancer
SEO Expert
Acest htaccess redirect din http pe https functioneaza fie ca sunteti pe apache fie apache + nginx.
Adaugati codul de mai jos primul in fisierul htaccess.

Cod:
RewriteEngine On

### WWW & HTTPS

# ensure www.
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# ensure https
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteCond %{HTTPS} off
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

### WWW & HTTPS

Este codul care-l folosesc si la roforum sa redirectionez toate link-urile spre https.
 
Loading...
Back
Sus