Advice on Configuring .HTaccess file to Redirect HTTP Subdomain to HTTPS Equivalent?

I haven't tested this, but it should allow you to capture the subdomain as well as the request RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(.*)\. Yourdomain\. Com$ RewriteRule ^(.*)$ https://%1.domain.Com/$1 R,L This rule however, will not work for requests that do not contain a subdirectory, so you actually need two rules RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^yourdomain\.

Com$ RewriteRule ^(.*)$ https://domain. Com/$1 R,L.

I haven't tested this, but it should allow you to capture the subdomain as well as the request. RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^(.*)\. Yourdomain\.

Com$ RewriteRule ^(.*)$ https://%1.domain. Com/$1 R,L This rule however, will not work for requests that do not contain a subdirectory, so you actually need two rules. RewriteCond %{SERVER_PORT} 80 RewriteCond %{HTTP_HOST} ^yourdomain\.

Com$ RewriteRule ^(.*)$ https://domain. Com/$1 R,L.

Thank you. THANK YOU! It works perfectly.

Out of curiosity, why is this so complex? In other words, why is the variable being defined as the potential subdomain --> (.*)? – Dongle Mar 22 at 1:33 Basically, you need to capture the subdomain in parenthesis in the conditional so that in the RewriteRule you can be sure you are redirecting the user to the proper subdomain.

Normally, you don't have to worry about this because most of the time when you do a rewrite you are doing it internally. Since you are changing protocols though, and can't simply make a local redirect, you need this extra step. – Wige Mar 24 at 14:15.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions