+ Reply to Thread
Results 1 to 8 of 8




  

Thread: Block IPs via HTACCESS

      
  1. #1
    Zap
    Zap is offline
    I Love Lesbians! Zap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond repute Zap's Avatar
    Join Date
    September 29, 2006
    Location
    Canada, Eh?
    Posts
    4,385
    Rep Power
    10
    Feedback Score
    0

    Default Block IPs via HTACCESS

    First of all, is the use of .htaccess efficient for blocking out ranges of IP addresses?
    And second, what would the file look like? What is the correct syntax?

    I want to block out entire IP address ranges from one of my forums and I'm leaning towards using .htaccess to do it.

    Can someone point me in the right direction or post an example or something, please?
    Toronto Forum ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ GET FREE EXPOSURE FOR YOUR BLOG!

  2. #2
    Translucent Purple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to beholdPurple Rain is a splendid one to behold Purple Rain's Avatar
    Join Date
    August 12, 2008
    Location
    Dancing In Purple Rain
    Posts
    1,665
    Rep Power
    5
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Quote Originally Posted by Zap View Post
    First of all, is the use of .htaccess efficient for blocking out ranges of IP addresses?
    And second, what would the file look like? What is the correct syntax?

    I want to block out entire IP address ranges from one of my forums and I'm leaning towards using .htaccess to do it.

    Can someone point me in the right direction or post an example or something, please?
    I think this is exactly what you need Mr Zap!

    Block IPs with .htaccess

  3. #3
    Zap
    Zap is offline
    I Love Lesbians! Zap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond repute Zap's Avatar
    Join Date
    September 29, 2006
    Location
    Canada, Eh?
    Posts
    4,385
    Rep Power
    10
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Thanks CS!

    Would anyone know, does blocking IP via cPanel cause more strain on the server than using .htaccess?
    Toronto Forum ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ GET FREE EXPOSURE FOR YOUR BLOG!

  4. #4
    Grand Masters grim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond reputegrim has a reputation beyond repute grim's Avatar
    Join Date
    September 22, 2006
    Posts
    10,060
    Rep Power
    25
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Cpanel just creates the .htaccess file doesn't it?

  5. #5
    Grand Masters Colleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond reputeColleen has a reputation beyond repute Colleen's Avatar
    Join Date
    September 22, 2006
    Location
    Canada
    Posts
    11,144
    Rep Power
    26
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Quote Originally Posted by GRIM View Post
    Cpanel just creates the .htaccess file doesn't it?
    Yes and/or adds to it.

  6. #6
    Grand Masters vectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nice vectro's Avatar
    Join Date
    September 5, 2008
    Location
    U.S.A.
    Posts
    1,499
    Rep Power
    4
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Quote Originally Posted by Zap View Post
    Thanks CS!

    Would anyone know, does blocking IP via cPanel cause more strain on the server than using .htaccess?
    When you add an IP to block via cPanel it just adds to your already existing .htaccess file or creates a .htaccess file if you don't have one. I recommend actually doing it the cPanel way since cPanel sort of "takes over" your .htaccess file regardless.

    vectro added 1 Minutes and 49 Seconds later...

    Also related to blocking IP addresses using .htaccess:

    blockacountry.com will generate entire block lists of countries that you can cut and paste into your .htaccess file. However, mod_geoip for the Apache webserver is more accurate and up to date if your host has that (or if you have your own server and install it yourself).
    Last edited by vectro; Oct 6th, 2008 at 12:42 pm. Reason: Automerged Doublepost

  7. #7
    Zap
    Zap is offline
    I Love Lesbians! Zap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond reputeZap has a reputation beyond repute Zap's Avatar
    Join Date
    September 29, 2006
    Location
    Canada, Eh?
    Posts
    4,385
    Rep Power
    10
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Quote Originally Posted by GRIM View Post
    Cpanel just creates the .htaccess file doesn't it?
    I thought that might have been the case, but wasn't 100% sure.

    Quote Originally Posted by vectro View Post
    Also related to blocking IP addresses using .htaccess:

    blockacountry.com will generate entire block lists of countries that you can cut and paste into your .htaccess file. However, mod_geoip for the Apache webserver is more accurate and up to date if your host has that (or if you have your own server and install it yourself).
    Thanks for blockacountry.com.
    I'll have to check them out.

    I have a VPS, but I'm only experiencing problems on one website.
    How is mod_geoip used and can it be used for one website while all the others on that server are unaffected?
    Toronto Forum ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ ♫ GET FREE EXPOSURE FOR YOUR BLOG!

  8. #8
    Grand Masters vectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nicevectro is just really nice vectro's Avatar
    Join Date
    September 5, 2008
    Location
    U.S.A.
    Posts
    1,499
    Rep Power
    4
    Feedback Score
    0

    Default Re: Block IPs via HTACCESS

    Quote Originally Posted by Zap View Post
    I thought that might have been the case, but wasn't 100% sure.



    Thanks for blockacountry.com.
    I'll have to check them out.

    I have a VPS, but I'm only experiencing problems on one website.
    How is mod_geoip used and can it be used for one website while all the others on that server are unaffected?
    mod_geoip is installed as a module for the Apache web server. I don't have much experience with VPS but I suspect an admin would have to install the module into the web server for you. mod_geoip is only called when certain directives to block specific countries are placed in .htaccess. Therefore, you would only place those directives on the sites that need country blocking.

    the blockacountry.com way creates very long cut and paste lists. It makes .htaccess big pretty quickly. The mod_geoip way is only uses a few lines.
    Vectro Web Hosting - Web hosting with solid tech support.

    x Proxy Host - Affordable PHP proxy hosting with proxy-specific features.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Role of .htaccess in SEO
    By virtuagurl in forum Search Engines
    Replies: 9
    Last Post: Oct 28th, 2010, 1:45 am
  2. form posts and .htaccess
    By Paramiliar in forum HTML & Website Design
    Replies: 21
    Last Post: Jan 4th, 2008, 7:00 am
  3. Block those ads and banners
    By iowadawg in forum Forum Lounge
    Replies: 6
    Last Post: Apr 18th, 2007, 3:02 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
WebTalkForums
WebTalkForums
Recent Forum Threads