himagarwal
himagarwal

Reputation: 39

How to block access to specific URL?

I am getting thousands of bot visits every hour to one specific URL of my website http://www.domain.com/.gtput/

I would like to block ALL traffic (human+bot) trying to access this URL. (This URL is not accessed by human, though!)

After lot of googling, I found an answer that worked from here --> Anyway to block visits to specific URLs, for eg via htaccess?. I am using following code in htaccess file to block this URL.

<IfModule mod_alias.c>
Redirect 403 /.gtput/
</IfModule>

Is there a BETTER way to block ALL traffic from accessing that one specific URL? So that I can save server resources (bandwidth etc.).

Upvotes: 0

Views: 5023

Answers (1)

Amit Verma
Amit Verma

Reputation: 41249

You can use the following Rule to forbid access to "/.gtput" :

RewriteEngine On 
RewriteCond %{THE_REQUEST} /.gtput/? [NC] 
RewriteRule ^ - [F,L]

Upvotes: 1

Related Questions