Hello, everyone. Very lucky to be here, I would like to ask a question.
I want to install an SSL certificate on my website. Hopefully, after the installation, every web page in the website can be browsed in this way: If I visit http: // URl, it will automatically jump to https: // URl.
I do not know which company's SSL is better. If you can help recommend one, I will be very grateful.
Another question:
In the server's root directory of my website, I have stored a file.htaccess.
content:
-----------------------------------------------
RewriteEngine On
RewriteCond% {SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.weldedmeshfence.com/$1 [R,L]
-------------------------------------------------- ------------------------------------------------
I found it won't work. Can anyone here help me correct it.
My website is http://www.weldedmeshfence.com.
Thank you very much.
How to achieve automatic transfer from http to https
Moderator: General Moderators
-
Zhong87916
- Forum Newbie
- Posts: 1
- Joined: Tue Mar 06, 2018 4:39 am
-
thinsoldier
- Forum Contributor
- Posts: 367
- Joined: Fri Jul 20, 2007 11:29 am
- Contact:
Re: How to achieve automatic transfer from http to https
It seems your SSL isn't set up correctly.
Once it is set up correctly, if your .htaccess file isn't working, make sure you vhost definition allows .htaccess files to operate.
Once it is set up correctly, if your .htaccess file isn't working, make sure you vhost definition allows .htaccess files to operate.
Warning: I have no idea what I'm talking about.
-
protopatterns
- Forum Newbie
- Posts: 9
- Joined: Sun Jan 28, 2018 11:18 am
Re: How to achieve automatic transfer from http to https
Hi Zhong87916,Zhong87916 wrote:after the installation, every web page in the website can be browsed in this way: If I visit http: // URl, it will automatically jump to https: // URl.
After you get your SSL resolved correctly, try this:
Code: Select all
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]