qclass Posted February 1, 2020 Share 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 Link to comment Share on other sites More sharing options...
Sn1F3rt Posted February 1, 2020 Share 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 Link to comment Share on other sites More sharing options...
qclass Posted February 1, 2020 Author Share 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! Everything (e.g. xxx) gets redirected to https://webmail.galactico.fashion/xxx Quote Link to comment Share on other sites More sharing options...
Luigi123 Posted February 1, 2020 Share Posted February 1, 2020 Perfect! Quote Link to comment Share on other sites More sharing options...
Krydos Posted February 2, 2020 Share 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 Link to comment Share on other sites More sharing options...
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.