1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

IP and domain name

Discussion in 'Apache' started by usf, Jan 14, 2016.

  1. #1
    hello, am using centos + apache. and the website is loaded via ip and domain.

    I am wanted to disable the website access via ip. how to make this possible?

    Looking forward for reply. Regards,
     
    usf, Jan 14, 2016 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    Eh, what? That is not possible. Well, technically, you can throw any visitor using the IP into the dumps, of course, instead of showing the site, but what would be the point?
     
    PoPSiCLe, Jan 14, 2016 IP
  3. oc-scott

    oc-scott Active Member

    Messages:
    420
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    68
    #3
    You could disable website access using IP address using .htaccess rules. The following rule would help:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^123\.123\.123\.123
    RewriteRule ^(.*)$ - [F,L]

    (Please replace 123\.123\.123\.123 with your server IP address).
     
    oc-scott, Mar 25, 2016 IP
    Sev7en likes this.