httpd.conf syntax

httpd.conf syntax

am 23.09.2009 15:55:37 von joydeep

Dear list,

I use some rewrite rule in .htaccess to prevent some bots like

`````````
RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]

a-lot-of

RewriteCond %{HTTP_USER_AGENT} ^Whacker [OR]
RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
RewriteCond %{HTTP_USER_AGENT} ^Xaldon
RewriteRule /*$ http://www.yourdomain.com [L,R]
```````````````````````````````

But I like to include these in httpd.conf ( globally) and not in
..htaccess any more. What might be the syntax then to include in httpd.conf ?

thanks

------------------------------------------------------------ ---------
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: httpd.conf syntax

am 23.09.2009 16:15:32 von aw

J. Bakshi wrote:
> Dear list,
>
> I use some rewrite rule in .htaccess to prevent some bots like
>
> `````````
> RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
> RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
>
> a-lot-of
>
> RewriteCond %{HTTP_USER_AGENT} ^Whacker [OR]
> RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
> RewriteCond %{HTTP_USER_AGENT} ^Xaldon
> RewriteRule /*$ http://www.yourdomain.com [L,R]
> ```````````````````````````````
>
> But I like to include these in httpd.conf ( globally) and not in
> .htaccess any more. What might be the syntax then to include in httpd.conf ?
>
Well, have you tried it ?
What problem do you get when you just do it ?

------------------------------------------------------------ ---------
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: httpd.conf syntax

am 24.09.2009 07:41:08 von joydeep

André Warnier wrote:
> J. Bakshi wrote:
>> Dear list,
>>
>> I use some rewrite rule in .htaccess to prevent some bots like
>>
>> `````````
>> RewriteCond %{HTTP_USER_AGENT} ^WebZIP [OR]
>> RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]
>>
>> a-lot-of
>>
>> RewriteCond %{HTTP_USER_AGENT} ^Whacker [OR]
>> RewriteCond %{HTTP_USER_AGENT} ^Widow [OR]
>> RewriteCond %{HTTP_USER_AGENT} ^Xaldon
>> RewriteRule /*$ http://www.yourdomain.com [L,R]
>> ```````````````````````````````
>>
>> But I like to include these in httpd.conf ( globally) and not in
>> .htaccess any more. What might be the syntax then to include in
>> httpd.conf ?
>>
> Well, have you tried it ?
> What problem do you get when you just do it ?

Yes, I have tried but no success. I have created a file called
blacklist.conf like this

`````````````````
RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [OR]
RewriteCond %{HTTP_USER_AGENT} ^Custo [OR]
RewriteCond %{HTTP_USER_AGENT} ^Wget [OR]

-- other rules------

RewriteRule ^.* - [F,L]
`````````````````````````

Now in httpd.conf I have added the file as

`````````
Include /etc/apache2/blacklist.conf
`````````````````

Restarted the apache and no error message.

BUT wget is successful. It was not successful when the configuration was
in .htaccess.
Have I missed something ?

Thanks

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

Re: httpd.conf syntax

am 24.09.2009 18:02:30 von Rich Bowen

--Apple-Mail-1-623043564
Content-Type: text/plain;
charset=US-ASCII;
format=flowed;
delsp=yes
Content-Transfer-Encoding: 7bit

>
>
> RewriteRule ^.* - [F,L]
> `````````````````````````
>
> Now in httpd.conf I have added the file as
>
> `````````
> Include /etc/apache2/blacklist.conf
> `````````````````
>
> Restarted the apache and no error message.
>
> BUT wget is successful. It was not successful when the configuration
> was
> in .htaccess.
> Have I missed something ?



vhosts do not automatically inherit rewrite directives. You may need
either to include this directly into the vhost(s) where you want it to
apply, or put:

RewriteOptions inherit

in each vhost.


--
Rich Bowen
rbowen@rcbowen.com




--Apple-Mail-1-623043564
Content-Type: text/html;
charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

-webkit-line-break: after-white-space; ">

type=3D"cite">
color=3D"#000000">
color=3D"#000000">
RewriteRule ^.* - =
[F,L]
`````````````````````````

Now in httpd.conf I have added =
the file as

`````````
Include =
/etc/apache2/blacklist.conf
`````````````````

Restarted the =
apache and no error message.

BUT wget is successful. It was not =
successful when the configuration was
in .htaccess.
Have I missed =
something =
?


vhosts do =
not automatically inherit rewrite directives. You may need either to =
include this directly into the vhost(s) where you want it to apply, or =
put:

RewriteOptions =
inherit

in each =
vhost.


=
color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; =
font-style: normal; font-variant: normal; font-weight: normal; =
letter-spacing: normal; line-height: normal; orphans: 2; text-align: =
auto; text-indent: 0px; text-transform: none; white-space: normal; =
widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; =
-webkit-border-vertical-spacing: 0px; =
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: =
auto; -webkit-text-stroke-width: 0px; ">
break-word; -webkit-nbsp-mode: space; -webkit-line-break: =
after-white-space; ">
--
Rich Bowen

div>

=

=

--Apple-Mail-1-623043564--