@herminia_bruen
To permanently redirect http://
and www.
URLs to https://
, you can set up a 301 redirect in your .htaccess file if you are using an Apache server. Here's how you can do it:
1 2 3 4 |
RewriteEngine On RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www. [NC] RewriteRule ^ https://example.com%{REQUEST_URI} [L,NE,R=301] |
Replace example.com
with your actual domain name.
This code will check if the request is using http://
or if the request is coming in with www.
and then redirect it to https://
without the www.
. The R=301
flag ensures that the redirect is permanent.
After adding this code to your .htaccess file, all URLs with http://
or www.
will be permanently redirected to https://
on your website.