Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2005
    Posts
    189
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Best way to Block unwanted referrals in htaccess?

    We had a really old php link redirect script on a website that has basically been piggybacked off of and passed around. So our web server was getting hit with a ton of requests for this specific page, lets call it "redirect.php" So there would be people coming from "redirect.php?http://www.mywebsite.com" etc...

    We've deleted the file on our server, but now everyone who is being pointed to or is using this script, is getting our 404 error page, and it's eating up a lot of bandwidth. I'm just curious what the best way to handle this would be. Would I be able to use htaccess to simply block all http requests for "redirect.php" on our site and stop it from going to the 404 page?

  • #2
    Regular Coder
    Join Date
    Oct 2004
    Posts
    363
    Thanks
    0
    Thanked 18 Times in 18 Posts
    Create an empty "redirect.php" file and they will only get minimal http headers returned.

  • #3
    Regular Coder
    Join Date
    Jan 2005
    Posts
    189
    Thanks
    6
    Thanked 0 Times in 0 Posts
    I ended up using htaccess to redirect that specific page to a blank page vs. the standard 404 page we use. I guess my question was whether requests to that page could just be totally denied. It's still using up some resources now but minimal.

  • #4
    New Coder
    Join Date
    Jun 2005
    Location
    Blackpool. UK
    Posts
    98
    Thanks
    0
    Thanked 4 Times in 4 Posts
    <Files redirect.php>
    deny from all
    </Files>


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •