Knowledge Base

How do I redirect HTTP to HTTPS via .htaccess?

To redirect all HTTP requests to HTTPS, simply add the following code to your .htaccess file:

RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Please rate this article to help us improve our Knowledge Base.

0 0