Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6155503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:26:50+00:00 2026-05-23T20:26:50+00:00

for some days i have been struggeling with making only certain ips accessing my

  • 0

for some days i have been struggeling with making only certain ips accessing my family site since i only want my family to be enable to access the site. ill need some help by your guys. This is how far i have gotten and if ip is not in database it will redirect to http://www.google.com .

The code:

$ip =$_SERVER['REMOTE_ADDR']; 
$result = mysql_query('SELECT * FROM `ips` WHERE `ip`="' . $ip . '"'); 

if(mysql_affected_rows($link) < 0){ 
header('location:http://google.com'); 
}  

EDIT: Got an idea of what i can use that wont change the computer mac address so the code will need change of the table and the names inside. How will i go about that , so when the user try to access my site it does a check if the mac adress of the computer is in database else redirect to google.com.

Kind regards Fredrik

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:26:51+00:00Added an answer on May 23, 2026 at 8:26 pm

    If you use Apache as your webserver you can change the directory node content in the httpd.conf configuration file to Allow from YOUR_IP and Deny from all. This is usually a more suitable place to create such restrictions.

    Note that the default Apache access for <Directory /> is Allow from All. This means that Apache will serve any file mapped from an URL. Change this with a block such as

    <Directory />
       Order Deny,Allow
       Deny from All
       Allow from IP
    </Directory>

    and then override this for directories you want accessible.

    For the redirect part you can add this to your httpd.conf to redirect to google on 403 Forbidden errors. Don’t forget to restart the webserver after you made the changes.

    ErrorDocument 403 http://www.google.com

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been trying since some days now to find a concrete answer for
for some days now I have been trying to make a simple mod_rewrite rule
I have been struggling with this for three days, I want to do a
I have been playing around with Umbraco 5 for some days now. I have
I have been trying for some days to use the channel.send_message API in GAE
We have been debugging a strange case for some days now, and have somewhat
For days I have been experimenting with long polling/comet implementation for my site. I
I have been struggling with this issue for some days now and I really
For a few days a have some problem. I need to show simple ProgressBar
Since it came out a few days ago, I am sure at least some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.