All you need is an additional virtualhost that will catch all requests that
need to be redirected. See http://wiki.apache.org/httpd/CanonicalHostNames for
details on this. Note that the example there redirects from www.example.comto
example.com, but the same principles apply.

Kind regards,
Mathijs Schmittmann

On Sat, Mar 17, 2012 at 6:58 PM, aparna Puram <aparnapu...@gmail.com> 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.
>

Reply via email to