PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Jul 23, 2018 4:50 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Sun Mar 18, 2018 12:06 am 
Offline
Forum Newbie

Joined: Tue Mar 06, 2018 5:39 am
Posts: 1
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.


Top
 Profile  
 
PostPosted: Sat Mar 24, 2018 12:59 am 
Offline
Forum Contributor

Joined: Fri Jul 20, 2007 11:29 am
Posts: 365
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.

_________________
Warning: I have no idea what I'm talking about.


Top
 Profile  
 
PostPosted: Mon Apr 02, 2018 6:39 pm 
Offline
Forum Newbie

Joined: Sun Jan 28, 2018 12:18 pm
Posts: 9
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.


Hi Zhong87916,

After you get your SSL resolved correctly, try this:

Syntax: [ Download ] [ Hide ]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 


If your server has the rewrite engine installed (almost all servers do), this makes all of your 'http://' rewrite to 'https://', without redirecting to your homepage.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group