How To Redirect HTTP To HTTPS For All Domain

Post Reply
crafter
Posts: 20
Joined: Wed Nov 10, 2021 11:43 pm

You gave a step for rediecting a wordpress site fromm http to https but the process does not seem to work for other non wordpress site like mine which also needs a http to https redirect. i tried to do from htaccess file of my site but i keep getting errors. please how can i do a http to https redirect. i have apache and nginx installed on my panel
User avatar
T4B
Posts: 166
Joined: Sat Jul 11, 2020 9:44 am
Been thanked: 5 times

crafter wrote: Mon Nov 22, 2021 7:56 pm You gave a step for rediecting a wordpress site fromm http to https but the process does not seem to work for other non wordpress site like mine which also needs a http to https redirect. i tried to do from htaccess file of my site but i keep getting errors. please how can i do a http to https redirect. i have apache and nginx installed on my panel
change the proxy template
image
image
Capture.PNG (27.71 KiB)
I hope this method helps you
mckaygerhard
Posts: 20
Joined: Thu Jun 08, 2023 6:32 pm
Been thanked: 1 time

this only for apache crap, what about non-aapache and nginx only?
sound4you
Posts: 8
Joined: Sun Jul 03, 2022 3:35 pm

MyVesta basic configuration apache, nginx. I don't know why dpeca and the myvesta team offers support and nginx php-fpm support. From what I've read around here, no. You can opt for the other VestaCp fork. Good luck!
shally87
Posts: 12
Joined: Fri Jun 11, 2021 5:04 pm

I turned on always use https in cloudflare.
gn7
Posts: 10
Joined: Wed Jul 13, 2022 4:51 am

You can just edit the config:
You edit the non-ssl file: sitename.nginx.conf file, like so:
(where xxx is your ip and replace [domainname] with your real domain name):

listen xx.xxx.xxx.xxx:80;
server_name [domainname];
#to force use of httpS:
return 301 https://$server_name$request_uri;

Remember to restart nginx. Works for me.
—-
spoidyjan
Posts: 6
Joined: Mon Nov 25, 2024 7:05 am

If you use Nginx, you can try what gn7 said. Edit the sitename.nginx.conf file and restart Nginx. For Apache, you can use .htaccess or the proxy template.
Post Reply