Apache / htaccess
Hello,
I was wondering if anyone can help me with the following: I would like to deprive access to a Apache WWW server using a new htaccess file.
I don't want anyone having access that is NOT using Mozilla, Netscape, MSIE, and so on.
Can anybody use the following file and have a succeful/stable web server?
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?somesite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?some-external-site.com/.*$ [NC]
RewriteRule \\.(gif|jpg)$ <a href="http://somesite.net/nasty.gif" target="_blank">http://somesite.net/nasty.gif</a> [R,L]
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^Mozilla* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Netscape* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Opera* [OR]
RewriteCond %{HTTP_USER_AGENT} !^MSIE* [OR]
RewriteCond %{HTTP_USER_AGENT} !^libwww-perl* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Googlebot* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Atomz* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Scooter*
RewriteRule /*$ <a href="http://somesite.net/error.html" target="_blank">http://somesite.net/error.html</a> [L,R]
As you can see, I'm also utilizing the anti-hotlinking option. Right now, I have an htaccess that has every app that I don't want, yet it takes way too much memory to use.
Thank you so much.
Mando\\
I was wondering if anyone can help me with the following: I would like to deprive access to a Apache WWW server using a new htaccess file.
I don't want anyone having access that is NOT using Mozilla, Netscape, MSIE, and so on.
Can anybody use the following file and have a succeful/stable web server?
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?somesite.net/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\\.)?some-external-site.com/.*$ [NC]
RewriteRule \\.(gif|jpg)$ <a href="http://somesite.net/nasty.gif" target="_blank">http://somesite.net/nasty.gif</a> [R,L]
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !^Mozilla* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Netscape* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Opera* [OR]
RewriteCond %{HTTP_USER_AGENT} !^MSIE* [OR]
RewriteCond %{HTTP_USER_AGENT} !^libwww-perl* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Googlebot* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Atomz* [OR]
RewriteCond %{HTTP_USER_AGENT} !^Scooter*
RewriteRule /*$ <a href="http://somesite.net/error.html" target="_blank">http://somesite.net/error.html</a> [L,R]
As you can see, I'm also utilizing the anti-hotlinking option. Right now, I have an htaccess that has every app that I don't want, yet it takes way too much memory to use.
Thank you so much.
Mando\\
Comments
well, I don't know apache, but I looked through that list and saw that OmniWeb is missing from that list <img src="graemlins/bugeye.gif" border="0" alt="[Skeptical]" /> wassup ?
edit: spellingh
[ 10-26-2002: Message edited by: /mandolux/ ]
[ 10-26-2002: Message edited by: Defiant ]</p>
P.S. I hope you're not mad at me for the money desktop ?
<strong>...okay. I'll add OmniWeb.</strong><hr></blockquote>
Thank You.
[quote]Originally posted by /mandolux/:
<strong>But still, nobody has helped me with this issue. I wonder why.</strong><hr></blockquote>
maybe because only 3hrs (edit: 4hrs + counting) have passed ?
[quote]Originally posted by /mandolux/:
<strong>P.S. I hope you're not mad at me for the money desktop ?</strong><hr></blockquote>
mad ? me ? no... ARGHGHH!!!!!
[ 10-26-2002: Message edited by: Defiant ]</p>
<strong>Hello,
I was wondering if anyone can help me with the following: I would like to deprive access to a Apache WWW server using a new htaccess....
Mando\\</strong><hr></blockquote>
don't turn the rewrite engine on twice. also, (not mozilla) or (not netscape) etc. will always evaluate to true. this should work:
[code]
RewriteCond %{HTTP_USER_AGENT} !^Mozilla [NC]
RewriteCond %{HTTP_USER_AGENT} !^Netscape [NC]
RewriteCond %{HTTP_USER_AGENT} !^Opera [NC]
RewriteCond %{HTTP_USER_AGENT} !^MSIE [NC]
RewriteCond %{HTTP_USER_AGENT} !^libwww-perl [NC]
RewriteCond %{HTTP_USER_AGENT} !^Googlebot [NC]
RewriteCond %{HTTP_USER_AGENT} !^Atomz [NC]
RewriteCond %{HTTP_USER_AGENT} !^Scooter [NC]
RewriteRule . <a href="http://somesite.net/error.html" target="_blank">http://somesite.net/error.html</a> [L,R] </pre><hr></blockquote>
However, keep in mind that this is pretty much useless because you'll upset people using exotic browsers and the UA string is easy to spoof anyway.
What Apache version did you used and in what platform?
thanx.
<strong>Thank you so much 123.
What Apache version did you used and in what platform?
</strong><hr></blockquote>
1.3.26, solaris
Make sure mod_rewrite is installed at all. Providers often don't like it because you can create unlimited subdomains and domains without paying.
(Maybe I'm mistaken, but a big.htaccess file can really take a lot of memory. When I was using an ht with over 50 apps, my memory usage went ballistic.)
On last thing - have you tried Solaris 9?
Thanx again.