How To Redirect HTTP To HTTPS For All Domain
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 templatecrafter 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
I hope this method helps you
-
- 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?
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.
—-
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.
—-