httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Selmer Ausland <sel.ausl...@shawcable.com>
Subject [users@httpd] Mod rewrite problems
Date Tue, 16 Dec 2003 21:10:01 GMT
Hello Group;
    I am running Apache 2.0.48, with Windows NT 4.0 on a webhosting
server. 
I want to prevent hot-linking to my graphics etc. and ban, or redirect,
spam-bots from my server.

I inserted the following code (below)to prevent hotlinking, to my images
etc., and to ban spambots, first, into the main body of my http conf and
when that did not work, I tried it in my root VirtualHost. It works fine
there. 

The problem now is, it now cuts of access to the images and also
prevents viewing the webpages.

When I access my webpages, the webpage shows up but not the graphics.
When I add the code to ban the spambots then I cannot view the webpages,
and receive a forbidden message.

The rewrite section also gives me the following error quote: 

"Redirection limit for this url exceeded. Unable to load the requested
page!"

This is the code I am using:

(All name-based VirtualHosts)

<VirtualHost *>
ServerAdmin webmaster@mydomain.com
DocumentRoot "D:/Apache2/htdocs"
ServerName www.mydomain.com
ServerAlias mydomain.com
<Directory "D:/Apache2/htdocs">
Options Indexes
AllowOverride AuthConfig Options FileInfo
Order Allow,Deny
Allow from all
</Directory>
RewriteEngine on
RewriteLog logs/modrewrite.log
RewriteLogLevel 1
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://mydomain.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mydomain.com/.*$ [NC]
RewriteRule.*\.(gif|GIF|jpg|mid|wav|mp3|avi|mpeg|)$ - [F]

RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR,NC]
RewriteCond %{HTTP_USER_AGENT} ^Bot\mailto:craftbot@yahoo.com [OR,NC]
RewriteRule .*\. http://www.mydomain.com/errors/404.html [R]
</VirtualHost>

Could some kind soul please advise me as to how I can enable the above,
and still be able to view my graphics and webpages. I have studied the
Documentation on Apache and Googled until I am ga-ga and still can't
seem to find the right combination. 

Most of the documentation seems pointed towards .htaccess files. I would
prefer to have to it in my main http conf if possible.

Any help would be appreciated.

Thanks. Selmer Ausland

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