Royden Rego
Royden Rego

Reputation: 132

Block site access other than selected people

I and couple of other guys are working on a web project of my Company. Now the site is in its development stages and its not even ready for beta testing. Lately the project has been gaining popularity and people have registered for the site and also seen the inside part of the site which we dint want anyone to see.

So I want to do something like the site is accessible only to couple of computers i.e who are working on the site and to users who just want to see the site. I have stored the site in root directory accessible directly by typing in the domain to gain easy access and also avoid database transfer during the release of site.

I could do it storing IP address and then comparing it with the Client's Ip, but in India the IP address keeps changing almost every time i.e its a dynamic IP Address.

And those try to access the site but not the web designers should be redirected to a different page.

Could anyone help us with this? A code for it in php would be really helpful for us.

Thank you

Upvotes: 0

Views: 122

Answers (1)

VarunBatraIT
VarunBatraIT

Reputation: 44

User cookies

Give them a special link which sets cookies and check in your website if there is cookie then allow access otherwise remove it.

Like

http://varunbatra.com/?whitelist=true

Which will set cookie and redirect them to home page in which you will have something like

if($_COOKIE['whitelist']!=true)
 die;

Upvotes: 2

Related Questions