Rewritecond and Rewriterules in httpd.conf
am 24.09.2009 11:06:54 von joydeep
Hello list,
I have spent half of the day but no success. apache gurus can help me
out. The Rewriterules are working well in my .htaccess file. As I have
multiple virtual hosts I like to place the common rules in httpd.conf
to get a performance bonus. Here are the rules I have in .htaccess
``````````````
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
-- other rules------
RewriteRule ^.* - [F,L]
`````````````````````````
So I have copied these working .htaccess rules in a file called blacklist.conf
Now in httpd.conf I have added the file as
`````````
Include /etc/apache2/blacklist.conf
`````````````````
Restarted the apache and no error message. I have also deleted those rules from .htaccess
BUT wget is successful. It was not successful when the configuration was in .htaccess.
I have found during google search that the Rewriterules are different in httpd.conf than .htacces I have also tried by putting "/" after the "^" but nothing was successful far. Could any one please give me a clue ?
------------------------------------------------------------ ---------
The official User-To-User support forum of the Apache HTTP Server Project.
See 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: [SOLVED] Rewritecond and Rewriterules inhttpd.conf
am 24.09.2009 12:28:48 von joydeep
J. Bakshi wrote:
> Hello list,
>
> I have spent half of the day but no success. apache gurus can help me
> out. The Rewriterules are working well in my .htaccess file. As I have
> multiple virtual hosts I like to place the common rules in httpd.conf
> to get a performance bonus. Here are the rules I have in .htaccess
>
> ``````````````
> RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
>
> RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
> RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
>
> -- other rules------
>
> RewriteRule ^.* - [F,L]
> `````````````````````````
>
> So I have copied these working .htaccess rules in a file called blacklist.conf
>
> Now in httpd.conf I have added the file as
>
> `````````
> Include /etc/apache2/blacklist.conf
> `````````````````
>
> Restarted the apache and no error message. I have also deleted those rules from .htaccess
>
> BUT wget is successful. It was not successful when the configuration was in .htaccess.
>
> I have found during google search that the Rewriterules are different in httpd.conf than .htacces I have also tried by putting "/" after the "^" but nothing was successful far. Could any one please give me a clue ?
>
Solved :-)
here is the link
http://zwiki.org/BlockingBadBotsInHttpdConf
cheers
>
>
>
> ------------------------------------------------------------ ---------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See 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 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