DEV Community

siddharth shukla
siddharth shukla

Posted on

How to redirect non-http to https using .htaccess file

Just put in the .htaccess file

RewriteEngine on

RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Read More: https://realprogrammer.in/how-to-redirect-non-http-to-https-using-htaccess-file/

Top comments (0)