How to Force http to https in AWS WordPress Package by Litespeed?


Well-Known Member

I am New Here...

So, Kindly Read this Post and Try to Answer me...

I'm New to Litespeed & Openlitespeed ( not even know the difference between ) :)

Installed WordPress Package through Amazon AWS EC2 -

After Configured EC2 Instance, I Logged into Putty SSH and Connected my Domain to the Litespeed Installation

by selecting Commands YES/NO

as mentioned in this Page -

BUT, I have selected NO when The Command asked for Let's Encrypt SSL.

Because I wanted to use Amazon's SSL ( Which is Good to Use with AWS CDN )

NB: If I use Let's Encrypt SSL, by selecting YES in the Putty Command, Then I have to Upload Custom SSL certificate to AWS and Renew it every 3 Months.

to Avoid that Hassle, I choose NO.

everything else, in Putty, is done... finally, it asked me to Upgrade server, and That Also Done.

After that...

I Logged into AWS and Created an SSL.

Changed WordPress Address (URL) & Site Address (URL) at the WordPress Backend.

Now, My website is Opening and Working With SSL - Kindly Check Your self.

Internal Links also Changed HTTP to HTTPS, Due to the WordPress Address Change.


What is My Problem?

Visit Now, Site Opening without HTTPS.

I wanted to Fix This.

I want to Redirect HTTP to HTTPS

if I Followed the Command in Putty ( for SSL ) and Choose the Let's Encrypt. There is an Option to Force HTTP to HTTPS

as per this URL

But, I did not choose Let's Encrypt and My SSL is Installed by AWS.


What do I want to do now?

Very Simple, Help me with Some commands,

That will redirect or force HTTP to HTTPS

Commands work with putty will be good.

ex: the command which RUNs when we select Let's Encrypt.

NB: Some people may come with htaccess rewrite codes.

but... I'm maybe not happy with that.

if no other solution, maybe I will use htaccess.

For Whom This Solution Will be GOOD For...?

For All People, using AWS + Litespeed WP Package + Custom SSL ( Other than Let's Encrypt )

I Couldn't find a tutorial anywhere online.

My last hope is this Official Forum.

let's see how you deal with this... :)


Staff member

How about adding these rules to LSWS web admin (port 7080) -> Virtual Hosts -> wordpress -> Rewrite Tab -> Edit Rewrite Rules.

RewriteCond %{SERVER_PORT} 80
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
Let us know if it works.



Well-Known Member
I visited https://my-server-ip:7080/login.php

also tested https://my-server-ip:7080

But Page not opens in the browser...

When I checked the URL

I came to understand, I need to Allo all IP to access port 7080.

So, I run a Command on Putty

ufw allow 7080
But, I received a error , says...

ERROR: You need to be root to run this script

how to solve this?
Last edited by a moderator:


Well-Known Member
the welcome message shows " ubuntu" but it is not the user name.

" admin " worked and logged in,

finally, I have set up SSL Force HTTPS.

Now, I request you to visit the HTTP Version of my domain.

That loads to HTTPS.

Happy :)

I need one more help from you,

That is, https://my-server-ip/phpmyadmin
How to get user ID and password to login with php my admin?

I need the user name and password as text format, not the encrypted.
Last edited by a moderator: