Hello Spliff, Well actually to explain the complete scenario,
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://<dnsname>%{REQUEST_URI} The above rewirte is set to redirect all the http requests to https request. It is working fine when I give the http://<localhostname> it is rewriting to https://<dnsname> but when I type https://<loacalhostname> it is redirecting to https:// <localhostname> I want it to be redirecting to https://<dnsname> as the ssl certificate CN : is the dnsname. On Sun, Mar 18, 2012 at 10:00 AM, SpliFF <spl...@warriorhut.org> wrote: > On 18/03/12 15:02, aparna Puram wrote: > > Hello Daniel/Mathijs, > > There is only one virtual host. > > server name is :selecvcp1.sw.ericsson.se > Dns name for that server is : select.ericsson.se > > both will redirect to the same apache > > when I use http:selectvcp1.sw.ericsson.se, I m being redirected to > https://select.ericsson.se. > However, When i type https://selectvcp1.sw.ericsson.se, I m still being > in https://selectvcp1.sw.ericsson.se > > I m not sure y. Is there any other way around? > > > If you expect https to redirect then your condition: > > RewriteCond %{SERVER_PORT} !^443$ > > ... is preventing that. What is the purpose of that condition if not to > prevent https from redirecting? > >