You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "Troy G." <tr...@sonetworld.com> on 2003/01/06 22:35:31 UTC

[users@httpd] Apache 1.3.27 mod_rewrite question

Hello,

Has anyone encountered this problem using mod_rewrite?  I am trying to
secure some of our url's to stop people
from linking to them etc.  I recompiled apache 1.3.27 to include mod
rewrite.
So far everything is working as expected.  When someone tries to link
directly to this site that is not listed as an
authorized referer they are being redirected to an error page.  This part is
working fine.  Any static images behind
the protected url works fine.  Now the problem starts here with trying to
stream content.  I have some Windows
media files in the same directory as the static jpg's.  When an authorized
host tries to view this stream, windows
media player says that the file is corrupt and cannot be viewed.  If I
comment out the rewrite rules, hup apache
then the windows media files can be viewed via windows media stream.  I have
read a while back on Google about someone
else mentioning this problem but I cannot seem to locate the thread again.
I have included some configs below as an example
 to see how things are currently setup.


<Directory "/var/pub/www/www.iwatchsecurity.com/htdocs/id123102">
        AllowOverride All
        RewriteEngine On
       RewriteCond %{HTTP_REFERER}
!^http://www.iwatchsecurity.com/accounts/customerA [NC]
        RewriteRule  ^/*   http://www.iwatchsecurity.com/access_denied.htm
[R,L]
</Directory>

Any help would be much appreciated.

Thanks in advance,

Troy





---------------------------------------------------------------------
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] Apache 1.3.27 mod_rewrite question

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 6 Jan 2003, Troy G. wrote:
> working fine.  Any static images behind
> the protected url works fine.  Now the problem starts here with trying to
> stream content.  I have some Windows
> media files in the same directory as the static jpg's.  When an authorized
> host tries to view this stream, windows
> media player says that the file is corrupt and cannot be viewed.

Some apps don't send referer headers.  That's life.  It means that you
can't trust the referer header restriction as a 100% reliable form of
access control.  It also means that you should ALWAYS add a rule that
allows clients through if the referer header is empty.  The consequences
of allowing through clients that send no referer are:

1. People can type the URL in directly and get to the content.

2. Some clients (eg. steaming media clients) will not be restricted at
all.

Number 1 is not very important, because you are trying to restrict other
websites from linking, not users themselves.  Number 2 could be a problem,
but is rather unavoidable given the underlying technology.

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