Hi @johnnyrook,
I won’t recommend closing port 80 just redirecting all traffic from HTTP to HTTPS.
There are a few ways to do so.
- Redirect to https using .htaccess
- Redirect to https using a WordPress plugin
- Redirect to https via Nginx
Redirect to https using .htaccess
In your website’s .htaccess you can add the following code
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
It should be enough to help you with the redirection.
Redirect to https using a WordPress plugin
Using a WordPress can be really easy, it will both help you redirect to HTTPS and solve the potential problem of a Mixed Content. Here are a couple of plugins you can use
https://wordpress.org/plugins/really-simple-ssl/
https://wordpress.org/plugins/wp-force-ssl/
Redirect to https via Nginx
If you are using Nginx, you can add the following server block
server {
listen 80;
server_name example.com www.example.com;
return 301 https://example.com$request_uri;
}
The above should be added in your website’s Nginx vhost file.
Additionally, please make sure to change example.com with your domain name.
Regards,
KDSys