DevChunks

Keep Your Website Hidden While Testing

This is a little trick I use a lot.

Quite often I am working on a website for a client that has an admin area. I like to give access to the admin area while I am still working on the front end design. This way the client can start adding products/content/whatever while I am building the actual website.

But of course, you don’t want the client to see your half-finished front end design. So get your IP address (if you don’t know how just visit http://www.whatismyip.com/) and add the following into your .htaccess file:

{code type=php}
order deny,allow
deny from all
allow from 80.xxx.xxx.xxx
{/code}

Where 80.xxx.xxx.xxx is your IP address. This will give a 403 forbidden to anyone accessing the site with anything other than that IP address. If you have multiple people working on the site simply add another line:

{code type=php}
order deny,allow
deny from all
allow from 80.xxx.xxx.xxx
allow from 82.xxx.xxx.xxx
{/code}

Keep in mind this method isn’t completely secure as IP addresses can be spoofed. However, for a quick and simple way of keeping a nosey client out you might find this ideal.

Share:

Leave a Reply

Your email address will not be published.

More Posts

How to use PHP Type Declarations

PHP has developed into a more strictly typed language in recent years. Type Declarations help with that and are a fairly new addition to PHP,

Iteration

If you have come to JavaScript from a background in Java or C, then you will like the variation on the for loop. It is

Context Object Manipulation

One of the key concepts of JavaScript is the keyword this, which signifies the JavaScript context object. If you write an inner function, you can access

Polymorphic Functions

It is possible to define multiple functions with the same name in JavaScript, and the last one of those that you define will be the