Redirect permanent http to https fails

The following redirect fails:

Redirect permanent http://192.168.0.200/private https://192.168.0.200/privat=
e

I have 2 virtual hosts with exactly the same DocumentRoot:

<VirtualHost 192.168.0.200:80>

<VirtualHost 192.168.0.200:443>

private is a directory under the DocumentRoot.

I can reach https://192.168.0.200/private directly.

Please help. Thanks.



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Jeff Shearer [ Mo, 28 Dezember 2009 20:50 ] [ ID #2027269 ]

Re: Redirect permanent http to https fails

Jeff Shearer wrote:
> The following redirect fails:
>
> Redirect permanent http://192.168.0.200/private https://192.168.0.200/private

That may be because you have not read the (excellent) on-line
documentation, which states :

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect permanent
is exactly equivalenent to "Redirect permanent", which itself

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
states that the URL is a URL *path*, starting with "/".

So, what happens if you just say

Redirect permanent /private https://192.168.0.200/private

?

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
aw [ Mo, 28 Dezember 2009 21:31 ] [ ID #2027270 ]

Re: Redirect permanent http to https fails

The Redirect permanent /private https://*******/private failed in the main s=
erver config. As did a bunch of other alternatives.

However, your suggestion to use RedirectPermanent provided by mod_alias with=
in the virtual host container worked like a charm.

I did not see this approach within the excellent documentation.

Thanks.

-----Original Message-----
From: "Andr Warnier" [aw [at] ice-sa.com]
Date: 12/28/2009 12:32 PM
To: users [at] httpd.apache.org
Subject: Re: [users [at] httpd] Redirect permanent http to https fails

Jeff Shearer wrote:
> The following redirect fails:
> =

> Redirect permanent http://192.168.0.200/private https://192.168.0.200/priv=
ate

That may be because you have not read the (excellent) on-line =

documentation, which states :

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect permanent
is exactly equivalenent to "Redirect permanent", which itself

http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirect
states that the URL is a URL *path*, starting with "/".

So, what happens if you just say

Redirect permanent /private https://192.168.0.200/private

?

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org



------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Jeff Shearer [ Mo, 28 Dezember 2009 23:42 ] [ ID #2027271 ]

Re: Redirect permanent http to https fails

On 28.12.09 17:42, Jeff Shearer wrote:
> The Redirect permanent /private https://*******/private failed in the main
> server config. As did a bunch of other alternatives.

You have virtual hosts configured, many directives from main server config
usually won't get used in this case.

> However, your suggestion to use RedirectPermanent provided by mod_alias
> within the virtual host container worked like a charm.

as would "Redirect permanent". Your problem was the context where you've had
this directive, not the directive itself.

> I did not see this approach within the excellent documentation.

maybe you just did not read or understand it fully...

And, I hope you do understand the difference between /private and /private/
in these cases
--
Matus UHLAR - fantomas, uhlar [at] fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Depression is merely anger without enthusiasm.

------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe [at] httpd.apache.org
" from the digest: users-digest-unsubscribe [at] httpd.apache.org
For additional commands, e-mail: users-help [at] httpd.apache.org
Matus UHLAR - fantoma [ Di, 29 Dezember 2009 14:06 ] [ ID #2027344 ]
Webserver » gmane.comp.apache.user » Redirect permanent http to https fails

Vorheriges Thema: Installing Apache 2.2.11 and 2.2.6 in the same Solaris 10 box
Nächstes Thema: what should be in the proxy directive