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? When On Sun, Mar 18, 2012 at 3:10 AM, Daniel Ruggeri <[email protected]>wrote: > On 3/17/2012 12:58 PM, aparna Puram wrote: > > Hello All, > > > > I am working on a project where I have to redirect all the http > > requests to https protocol. I have configured the following rewrite > > rules and it is working fine. > > > > RewriteEngine On > > RewriteCond %{SERVER_PORT} !^443$ > > RewriteRule ^(.*)$ https://<dns name>$1 [L,R] > > > > > > then http://<dns name> is redirecting to https://<dns name> > > & http://<localhost name> is redirecting to htps://<dns name> > > > > However, https://<localhost name> is not being redirected to > > https://<dnsname>, It is just being https://localhost > > > > Since I have a ssl installed with the common name (CN) as the dns name. > > > > I need the https://local host name to be redirected to https://dns name. > > > > Kindly suggest me what needs to be done. > > > > Thanks in advance. > > > > > > Is this done at the server level or in vhosts? How many vhosts? I ask > because I typically use a configuration like this: > <VirtualHost *:80> > RedirectPermanent / https://somewhere.com/ > </VirtualHost> > > However, I typically only have one :80 vhost and one :443 vhost. > > If that can't work, I can't speak to why your rule isn't working... but > you should definitely anchor with slashes like so: > RewriteEngine On > RewriteCond %{SERVER_PORT} !^443$ > RewriteRule ^/(.*)$ https://<dns name>/$1 [L,R] > > You can also try enabling the rewrite log for more details. > > -- > Daniel Ruggeri > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
