I currently have a virtualhost within Apache that is using mod_cband
and mod_rewrite
.
I am using mod_cband
to limit the number of connections per remote user. When this limit is exceeded, it is supposed to return 503 Service Unavailable
which is the mod_cband
default.
If the limit is not exceeded then mod_rewrite
should rewrite the URL according to the rules I have specified.
Unfortunately, mod_rewrite
seems to take some sort of priority over mod_cband
as the rewrite occurs even when the limit is exceeded and 503 Service Unavailable
is never returned.
Is there anyway to force mod_cband
to be applied before mod_rewrite
? Config is as follows:
<VirtualHost *:80>
ServerName a.domain.com
ServerAdmin [email protected]
CBandRemoteSpeed 1024 1 10
RewriteEngine on
# Some other rewrite rules.
RewriteRule (.*) https://a.domain.com? [R]
...
</VirtualHost>