You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bill Dossett <bd...@emtex.com> on 2003/01/30 14:09:18 UTC
[users@httpd] rewriting http to https, what am I doing wrong?
Hi,
I think I've followed the best examples of
how to rewrite an http:// url to an https://
rule, however, no matter how I write it,
I wind up in a loop.
I am using stock apache 2.0.40 that
comes with redhat 8.0.
I have a directory under my web server
/ir
that I want the contents of to only be available
via https...
I am using this rewrite:
<Location /ir>
AllowOverride FileInfo Indexes AuthConfig Limit
DirectoryIndex index.cgi
RewriteEngine on
RewriteRule ^.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
</Location>
and it is in my /etc/httpd/conf/httpd.conf
file and that is the only place that it lives...
but when I access http://www.emtex.com/ir
it just goes into a loop....
I've turned logging on, but that just shows the steps
of the loop it is going thru in more detail... I guess
I've missed something, but I can't seem to see what.
This is pretty much my first attempt at a rewrite rule,
but I am unclear as to why it loops. I have tried the
NS flag as I am using index.cgi but that didn't stop the
loop nor did using the [L] flag. The rewriting is working
as I can see it in the log, but I need it to stop after
the first rewrite.
Thanks
Bill Dossett
---------------------------------------------------------------------
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] rewriting http to https, what am I doing wrong?
Posted by Bill Dossett <bd...@emtex.com>.
ahhh, I see, didn't think of that, but
of course it does, by the time it gets
the header it should be ok I guess...
I'll try it for a quick fix.
thanks
Bill
Sean Neakums wrote:
> commence Bill Dossett quotation:
>
>
>>I guess that might work, but what if user just types in
>>
>>www.example.com/ir
>>
>>with no http on the front?
>
>
> That won't have any effect on Apache. In fact, when the browser makes
> a HTTP request, it's formatted like this:
>
> GET /ir HTTP/1.1
> Host: www.example.com
>
> Apache reassembles the URL to pass around internally.
>
---------------------------------------------------------------------
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] rewriting http to https, what am I doing wrong?
Posted by Sean Neakums <sn...@zork.net>.
commence Bill Dossett quotation:
> I guess that might work, but what if user just types in
>
> www.example.com/ir
>
> with no http on the front?
That won't have any effect on Apache. In fact, when the browser makes
a HTTP request, it's formatted like this:
GET /ir HTTP/1.1
Host: www.example.com
Apache reassembles the URL to pass around internally.
--
/ |
[|] Sean Neakums | Size *does* matter.
[|] <sn...@zork.net> | That's why I use Emacs.
\ |
---------------------------------------------------------------------
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] rewriting http to https, what am I doing wrong?
Posted by Bill Dossett <bd...@emtex.com>.
I guess that might work, but what if user just types in
www.example.com/ir
with no http on the front?
thanks
Bill
Sean Neakums wrote:
> commence Bill Dossett quotation:
>
>
>><Location /ir>
>> AllowOverride FileInfo Indexes AuthConfig Limit
>> DirectoryIndex index.cgi
>> RewriteEngine on
>> RewriteRule ^.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
>></Location>
>
>
> Would changing the RewriteRule so that it does not match https URLs
> work? E.g:
>
> RewriteRule ^http:.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
>
---------------------------------------------------------------------
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] rewriting http to https, what am I doing wrong?
Posted by Sean Neakums <sn...@zork.net>.
commence Bill Dossett quotation:
> <Location /ir>
> AllowOverride FileInfo Indexes AuthConfig Limit
> DirectoryIndex index.cgi
> RewriteEngine on
> RewriteRule ^.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
> </Location>
Would changing the RewriteRule so that it does not match https URLs
work? E.g:
RewriteRule ^http:.*/ir(.*)$ https://%{SERVER_NAME}/ir$1 [NS]
--
/ |
[|] Sean Neakums | Size *does* matter.
[|] <sn...@zork.net> | That's why I use Emacs.
\ |
---------------------------------------------------------------------
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