httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Glenn Bjurestrand" <gl...@bjurestrand.se>
Subject SV: [users@httpd] Is it possible to allow only 1 type of browsers to access an Apche2 website?
Date Fri, 14 May 2004 02:34:10 GMT
Thank you Brent!

Mod_rewrite was the perfect solution for my problem.

Regards,
Glenn B

-----Ursprungligt meddelande-----
Från: Brent 'Dax' Royal-Gordon [mailto:brent@brentdax.com] 
Skickat: den 13 maj 2004 20:45
Till: users@httpd.apache.org
Ämne: Re: [users@httpd] Is it possible to allow only 1 type of browsers to
access an Apche2 website?

Glenn Bjurestrand wrote:
> I’m working on a portal for 3G phones. There people should be able to 
> download free contents to there 3G handsets. The portal is not ready yet 
> but already there are people that are stealing the contents of the 
> portal and put it up on none free websites. Now I wonder is there a way 
> to redirect other browser and offline browser (Like Website extractor 
> and Black widow) to a read me page, and only allow browsing with the G3 
> handset on the portal?

mod_rewrite should be able to handle this for you.

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! I have not tested these directives, and am not very familiar with !!
!!    mod_rewrite. Please test these directives thoroughly before    !!
!!                        trying to use them.                        !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

     RewriteEngine On
     RewriteCond %{HTTP_USER_AGENT} !^SomeRegex
     RewriteRule 3gdir/.* - [F]

(Replace SomeRegex with a pattern that will match all the browsers you 
want to let through.)

This rule set will mean that any browser that tries to access 3gdir but 
doesn't match the pattern will get a 403 Forbidden error.  To understand 
how, see <http://httpd.apache.org/docs-2.0/mod/mod_rewrite.html>.

-- 
Brent "Dax" Royal-Gordon <brent@brentdax.com>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.

---------------------------------------------------------------------
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




---------------------------------------------------------------------
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


Mime
View raw message