Redirect HTTP to HTTPS in VestaCP?

djsmiley2k

Well-known member
Registered
Joined
Jul 10, 2016
Messages
198
Points
18
I am having a VPS package and installed VestaCP control panel, it is new to me and I have less experience for using VestaCP. Can you tell me the way to redirect HTTP to HTTPS in VestaCP? Does it use same way as other hosting panels?
 

Localnode

Well-known member
Registered
Joined
Dec 15, 2015
Messages
333
Points
43
Why not use .htaccess? If your server is running Apache or Litespeed it's pretty simple:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
Or redirect it including www.
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]   
</IfModule>
 

KnownHost-DanielP

Well-known member
Hosting Provider
Registered
Joined
Mar 1, 2018
Messages
121
Points
28
I am having a VPS package and installed VestaCP control panel, it is new to me and I have less experience for using VestaCP. Can you tell me the way to redirect HTTP to HTTPS in VestaCP? Does it use same way as other hosting panels?
I'm not overly familiar with Vesta CP but it appears they have a Nginx template that forces https

https://vestacp.com/docs/#how-to-force-https

Might give that a shot.
 
Latest Threads
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top