Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Banning a domain from accessing awebsite

  • 04-06-2003 08:31AM
    #1
    Moderators, Technology & Internet Moderators, Regional South East Moderators, Paid Member Posts: 28,618 Mod ✭✭✭✭


    Right thought I'd ask this here,
    I want to ban a domain from accessing a website.

    So lets say I'm running mydomain.com and a person is connected to the net using iol, so when they access my website my website see's there coming from .etcetc.etc.blaa.iol.ie and will not allow them to access my website.

    Can this be done using .httaccess and is it possiable that when a user connects from etc.blaa.iol.ie they will be prompted for a user/pass.

    But when a user access my site connected using Eircom, (etc.blaa.eircom.net) they can access my website fine without being prompted for a password


    Any ideas how this can be done?


Comments

  • Closed Accounts Posts: 382 ✭✭misterq


    Can be done in two ways:

    1) In the Apache server configuration file, by adding an entry such as:
    <Directory /home/domain/domain1/web/>
    Deny from 207.44.208.89
    </Directory>

    2) .htaccess
    <Limit GET PUT POST>
    order allow,deny
    allow from all
    deny from etcetc.etc.blaa.iol.ie
    </Limit>

    The only thing to note is that if the person you are trying to block is connecting using a dynamic IP address, you really would have to block out an IP range or domain rather than just on IP address or hostname.
    eg: deny from .iol.ie
    deny from 207.44.208.


    Ronan


  • Closed Accounts Posts: 1,412 ✭✭✭tom-thebox


    Originally posted by misterq
    Can be done in two ways:

    1) In the Apache server configuration file, by adding an entry such as:
    <Directory /home/domain/domain1/web/>
    Deny from 207.44.208.89
    </Directory>


    Hey Cabaal

    I can set this up for you in the virtual config for your domain on the server you are on.

    Although if you can get it working via .htaccess it would give you control in the future.

    Regards


  • Moderators, Technology & Internet Moderators, Regional South East Moderators, Paid Member Posts: 28,618 Mod ✭✭✭✭Cabaal


    Originally posted by misterq

    The only thing to note is that if the person you are trying to block is connecting using a dynamic IP address, you really would have to block out an IP range or domain rather than just on IP address or hostname.
    eg: deny from .iol.ie
    deny from 207.44.208.


    Also can it prompt for a password when accessing from iol.ie?


  • Closed Accounts Posts: 382 ✭✭misterq


    AuthUserFile /usr/home/domain/htpasswd
    AuthGroupFile /usr/home/domain/htgroup
    AuthName "IOL Password Holders Only"
    AuthType Basic
    Satisfy Any
    <Limit GET POST>
    order allow,deny
    allow from all
    deny from *.iol.ie
    require group iolusers
    </Limit>

    AuthGroupFile:
    iolusers: ioluser1


    should work.


  • Moderators, Technology & Internet Moderators, Regional South East Moderators, Paid Member Posts: 28,618 Mod ✭✭✭✭Cabaal


    Yep that works perfectly :-)

    Thanks lads..


  • Advertisement
Advertisement