qclass Posted February 1, 2020 Posted February 1, 2020 (edited) How can I force redirect webmail.galactico.fashion to https://webmail.galactico.fashion My server is : Johnny Edited February 1, 2020 by qclass Quote
Sn1F3rt Posted February 1, 2020 Posted February 1, 2020 Go to the folder of your subdomain, and create a file named .htaccess and paste the following content into the file: IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://webmail.galactico.fashion/$1 [R,L] </IfModule>That's redirect all HTTP requests on the subdomain to https. Hope that helps! Quote
qclass Posted February 1, 2020 Author Posted February 1, 2020 On 2/1/2020 at 5:28 PM, sohamb03 said: Go to the folder of your subdomain, and create a file named .htaccess and paste the following content into the file:IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://webmail.galactico.fashion/$1 [R,L] </IfModule>That's redirect all HTTP requests on the subdomain to https. Hope that helps! Everything (e.g. xxx) gets redirected to https://webmail.galactico.fashion/xxx Quote
Krydos Posted February 2, 2020 Posted February 2, 2020 I recommend adding an exception for the .well-known directory to allow ssl to be renewed in the future: RewriteEngine On RewriteCond %{HTTPS} !=on RewriteCond %{REQUEST_URI} !^/.well-known/ [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.