+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: ip block country

  1. #1
    vlatkomk is offline x10Hosting Member vlatkomk is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    11

    ip block country

    Hi
    I want to restrict a page where someone comes from abroad to show another page and when the national network to the actual page opens.
    I'm not familiar so much for help.
    Thank you

  2. #2
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: ip block country

    The only way to accomplish this is to run a database which converts the IP address into a latitude, longitude and then country. These databases would run you about $1000 and are very large, about 150meg+.

  3. #3
    vlatkomk is offline x10Hosting Member vlatkomk is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    11

    Re: ip block country

    Is there a code and how to do that my question was not what takes place

  4. #4
    driveflexfuel is offline x10 Sophmore driveflexfuel is an unknown quantity at this point
    Join Date
    Jul 2008
    Posts
    159

    Re: ip block country

    Im guessing what you meant is you have two index pages.

    if someone is from your country you want it to display say country_mine.html

    and if someone is from another country you want to display country_other.html


    There is no way to do this without a sql database. If you had the database it would be a simple 10-15 lines of php.
    Last edited by driveflexfuel; 09-28-2009 at 01:22 PM.

  5. #5
    vlatkomk is offline x10Hosting Member vlatkomk is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    11

    Re: ip block country

    We have such a code, ie . htaccess

    example

    <Files index.php>
    order allow,deny
    deny from 62.93.69.0/24
    </Files>
    <Files admin.php>
    order allow,deny
    deny from 188.117.192.0/23
    </Files>
    I need a code that directs it to the pages

  6. #6
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: ip block country

    Code:
    RewriteCond %{REQUEST_URI}   fileYouWantToProtect
    RewriteCond %{REMOTE_ADDR} ^62\.93\.69\.0$
    RewriteRule  fileYouWantToProtect   fileToBeDirectedTo
    Or something similar sounds like what you want to do.
    The second condition can be adjusted to do ranges of ip's. But then you need a new Condition for each range of ips.
    Nothing is always absolutely so.

  7. #7
    vlatkomk is offline x10Hosting Member vlatkomk is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    11

    Re: ip block country

    Make example code I have placed above it would look like there are set exemplary page

    Thank you

  8. #8
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: ip block country

    You should be able to find free IP locator services that convert an IP address into a latitude and longitude, and free reverse geocoding services to convert geographic coordinates to an address.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  9. #9
    vlatkomk is offline x10Hosting Member vlatkomk is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    11

    Re: ip block country

    It is okay but I need code like this will really work.
    Above wrote that not understand so much love together to invent something like this did not understand.
    Thanks a lot

  10. #10
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: ip block country

    You could also go through the http parameters, but that is a way more complex and unsure method.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. block requests from your country
    By TE... in forum Free Hosting
    Replies: 3
    Last Post: 12-26-2008, 12:17 AM
  2. Replies: 3
    Last Post: 06-06-2008, 08:53 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers