Re: Urgent !!! - Rewrite issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Spliff,

The rewirtes that you have specified is performing the same.

https://<localhost> is not being redirected to https://<dnsname>

However,

http://<localhost> is redirected to https://<dns name>

Since the ssl ceritificate is installed only for the dns name, When I am accessing https://localhost, It says ssl is installed for differncet common name, Do you still want to access the site.

Please let me know if there is any fix to this.

On Sun, Mar 18, 2012 at 12:45 PM, SpliFF <spliff@xxxxxxxxxxxxxx> wrote:
I think you're saying you want:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^<localhostname>$
RewriteRule (.*) https://<dnsname>%{REQUEST_URI}

As long as you are checking for https or port 443 in the rewrite condition you're not redirecting anywhere on HTTPS
requests. If you want HTTPS to redirect then your condition is blocking that. The rules above send ALL requests to
the dnsname using https regardless of the scheme actually requested. That seems to be the behaviour you're asking for.

This all assumes you are using this rule in your port 80 and port 433 virtualhosts.



On 18/03/12 17:45, aparna Puram wrote:
> 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 <spliff@xxxxxxxxxxxxxx <mailto:spliff@xxxxxxxxxxxxxx>> 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 <http://selecvcp1.sw.ericsson.se>
>>     Dns name for that server is : select.ericsson.se <http://select.ericsson.se>
>>
>>     both will redirect to the same apache
>>
>>     when I use http:selectvcp1.sw.ericsson.se <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?
>
>



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux