You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Ken Robinson <ke...@gmail.com> on 2007/06/18 17:49:54 UTC
[users@httpd] Redirect of http to https going into an infinite loop
I'm trying to help my boss solve his rewrite problem. He's trying the
following code in the config file, but the results are an infinite
loop of rewrites:
<VirtualHost *:7778>
ServerName virtual1
Port 80
ServerAdmin rakhtar@tangible-tech.com
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*)$ https://virtual1/$1 [L,R]
Is there any way of making this work without specifying a different target host?
Thanks in advance.
Ken
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Redirect of http to https going into an infinite loop
Posted by Joshua Slive <jo...@slive.ca>.
On 6/18/07, Ken Robinson <ke...@gmail.com> wrote:
> On 6/18/07, Brett Neumeier <br...@centro.net> wrote:
> > On Mon, 2007-06-18 at 17:16 +0100, Tony Stevenson wrote:
> > > On Mon, June 18, 2007 4:49 pm, Ken Robinson wrote:
> > > > I'm trying to help my boss solve his rewrite problem. He's trying the
> > > > following code in the config file, but the results are an infinite loop of
> > > > rewrites:
> >
> > Is there any reason your boss doesn't want to just use something like:
> >
> > <VirtualHost *:7778>
> > ServerName virtual1
> > Port 80
> > Redirect permanent / https://virtual1/
> > </VirtualHost>
> >
> > I mean, you don't have to use mod_rewrite to do a redirect.
>
> He tried that suggestion and it still loops.
>
> He also tried the code from the article at
> http://rewrite.drbacchus.com/rewritewiki/SSL
>
> He said that it still loops then too.
Then there is likely something in your SSL <VirtualHost> that is
pointing back to your non-ssl host, causing a loop. Those configs on
their own certainly don't loop.
Joshua.
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Redirect of http to https going into an infinite loop
Posted by Ken Robinson <ke...@gmail.com>.
On 6/18/07, Brett Neumeier <br...@centro.net> wrote:
> On Mon, 2007-06-18 at 17:16 +0100, Tony Stevenson wrote:
> > On Mon, June 18, 2007 4:49 pm, Ken Robinson wrote:
> > > I'm trying to help my boss solve his rewrite problem. He's trying the
> > > following code in the config file, but the results are an infinite loop of
> > > rewrites:
>
> Is there any reason your boss doesn't want to just use something like:
>
> <VirtualHost *:7778>
> ServerName virtual1
> Port 80
> Redirect permanent / https://virtual1/
> </VirtualHost>
>
> I mean, you don't have to use mod_rewrite to do a redirect.
He tried that suggestion and it still loops.
He also tried the code from the article at
http://rewrite.drbacchus.com/rewritewiki/SSL
He said that it still loops then too.
Ken
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Redirect of http to https going into an infinite
loop
Posted by Brett Neumeier <br...@centro.net>.
On Mon, 2007-06-18 at 17:16 +0100, Tony Stevenson wrote:
> On Mon, June 18, 2007 4:49 pm, Ken Robinson wrote:
> > I'm trying to help my boss solve his rewrite problem. He's trying the
> > following code in the config file, but the results are an infinite loop of
> > rewrites:
Is there any reason your boss doesn't want to just use something like:
<VirtualHost *:7778>
ServerName virtual1
Port 80
ServerAdmin rakhtar@tangible-tech.com
Redirect permanent / https://virtual1/
</VirtualHost>
I mean, you don't have to use mod_rewrite to do a redirect.
Cheers,
bn
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Redirect of http to https going into an infinite
loop
Posted by Tony Stevenson <to...@pc-tony.com>.
On Mon, June 18, 2007 4:49 pm, Ken Robinson wrote:
> I'm trying to help my boss solve his rewrite problem. He's trying the
> following code in the config file, but the results are an infinite loop of
> rewrites:
>
>
> <VirtualHost *:7778>
> ServerName virtual1
> Port 80
> ServerAdmin rakhtar@tangible-tech.com
> Options +FollowSymLinks
> RewriteEngine On
> RewriteCond %{SERVER_PORT} !^443$
> RewriteRule ^/(.*)$ https://virtual1/$1 [L,R]
>
>
> Is there any way of making this work without specifying a different
> target host?
>
Ken, take a look at this article, it will help you redirect http traffic
to https.
http://rewrite.drbacchus.com/rewritewiki/SSL
Regards,
Tony
---------------------------------------------------------------------
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@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org