Using Rewrite to block host name
9 posts
• Page 1 of 1
Using Rewrite to block host name
Hi,
Is there a way using isapi to block host names?
i.e. i want to forward or block all traffic from shark.tothsoft.hu etc.
Thanks!
Is there a way using isapi to block host names?
i.e. i want to forward or block all traffic from shark.tothsoft.hu etc.
Thanks!
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Using Rewrite to block host name
Hello,
Do you mean you want to block all traffic coming from a specific web-site? I'd suppose you'll need %{HTTP_REFERER} variable. Let me know if you have any questions.
Regards
Do you mean you want to block all traffic coming from a specific web-site? I'd suppose you'll need %{HTTP_REFERER} variable. Let me know if you have any questions.
Regards
Re: Using Rewrite to block host name
Hello,
No, i mean blocking/forwardind all traffic from a specific Hostname / ISP.
ie. cmo73.neoplus.adsl.tpnet.pl wich is the host name of 83.31.142.73
or hosting.warkeeper.net wich is the hostname of 195.2.240.101.
Thanks.
No, i mean blocking/forwardind all traffic from a specific Hostname / ISP.
ie. cmo73.neoplus.adsl.tpnet.pl wich is the host name of 83.31.142.73
or hosting.warkeeper.net wich is the hostname of 195.2.240.101.
Thanks.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Using Rewrite to block host name
I believe I've given you the right answer, if I understood the task correctly.
If not, you can always look up needed variable from here - http://www.helicontech.com/isapi_rewrit ... teCond.htm
Regards
Andrew
If not, you can always look up needed variable from here - http://www.helicontech.com/isapi_rewrit ... teCond.htm
Regards
Andrew
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Using Rewrite to block host name
I'd also suggest taking a look at our examples section - http://www.helicontech.com/isapi_rewrit ... amples.htm and FAQ - http://www.helicontech.com/articles/mod_rewrite-faq/
Regards
Regards
Re: Using Rewrite to block host name
I use the HTTP_REFERER, it's great for redirecting traffic from a website.
But i was asking about redirecting a HOST NAME of some ISP.
For example: static.75.32.4.46.clients.your-server.de
or: 204023.n.ncyu.edu.tw etc.
I did some tests using the HTTP_HOST + the host name i need to redirect -
but not working
But i was asking about redirecting a HOST NAME of some ISP.
For example: static.75.32.4.46.clients.your-server.de
or: 204023.n.ncyu.edu.tw etc.
I did some tests using the HTTP_HOST + the host name i need to redirect -
but not working
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Using Rewrite to block host name
I believe this is the first time I see a request like this. Tried to do some research and it seems liek people do not block by ISP, it needs to be an IP range. Which we have described here - http://www.helicontech.com/articles/mod_rewrite-faq/
Re: Using Rewrite to block host name
thanks anyway, i appreciate your effort.
PS. there is a way doing it in Apache, using a map:
RewriteEngine on
RewriteMap hosts-deny txt:/path/to/hosts.deny
RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^ - [F]
And in the map "hosts.deny" so:
bsdti1.sdm.de -
another.host.name -
Question if maps like host.deny will work using ISAPI on iis/win.
Thanks again.
PS. there is a way doing it in Apache, using a map:
RewriteEngine on
RewriteMap hosts-deny txt:/path/to/hosts.deny
RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND
RewriteRule ^ - [F]
And in the map "hosts.deny" so:
bsdti1.sdm.de -
another.host.name -
Question if maps like host.deny will work using ISAPI on iis/win.
Thanks again.
- HeliconAndrew
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Using Rewrite to block host name
Well, why didn't you tell that you have an example like this.
Surely it'll work. The mapfiles syntax is quite similar and should work, there's more about mapfiles in FAQ under 'Comprehensive Mapfile Insight'.
I believe it should work. If it doesn't we'd need to see rewrite.log for the request in question.
Regards
Surely it'll work. The mapfiles syntax is quite similar and should work, there's more about mapfiles in FAQ under 'Comprehensive Mapfile Insight'.
I believe it should work. If it doesn't we'd need to see rewrite.log for the request in question.
Regards
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests