• 0

close my website for everyone but me?


Question

Is this possible? to close my website for everyone, except me. Either via php or htaccess and IPs or sumthin' ?

It's about to be re launching and i want to have any access to my site directed to a page saying it's closed, but except for me.

is it possible?

Link to comment
Share on other sites

16 answers to this question

Recommended Posts

  • 0

What happens if Forcer was to delete that Cookie? Don't know much about that kind of setup, but couldn't that cause issues?

I've setup Windows Authentication on an IIS7 Windows Server before, plus I think you can create a htaccess file which you can lock down.

Or even more, you could just develop the site in a sub-directory, which means that when a user hits your website directly they could just get a offline page which would be set as your Index file?

Link to comment
Share on other sites

  • 0

forcer would has to create the cookie to allow access anyway, if he were to delete it, he'd just have to re-create it. You could create a server-side mechanism to do this, but then you're opening it up to possible abuse. If he had a static IP on his client though, you're right, creating an access white list would be the preferred method. :)

Link to comment
Share on other sites

  • 0

Just toss the following into an .htaccess file in the directory you want off-limits to everyone BUT you.

AuthName "Protected"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 192.168.1.1
</Limit> 

Just change 192.168.1.1 to your IP. Go to ipchicken if you don't know your IP address. You can always then just create a special 403.html template page that will show up when a user hits that page versus showing the Forbidden error message.

Link to comment
Share on other sites

  • 0

All of these solutions are overkill...

The simplest is using .htaccess, but ip limit might be a problem if you have a non static ip... instead I would recommend using .htaccess to change the "index" to something other than index.php/.htm/.html (or whatever you are using) and then password protecting your entire site using htaccess.

Your "temporary" new index may be best in a subfolder and then allow access to that directory using htaccess.

Anyone who visits the general site www.......com will then see the temporary index, anyone who forcefully tries to go anywhere else or has a bookmark etc. with get a password prompt (which of failing or canceling you can redirect back to the temporary index)

On logging in the first time save your password and you wont have to keep entering it.

Simples.

Link to comment
Share on other sites

  • 0

All of these solutions are overkill...

The simplest is using .htaccess, but ip limit might be a problem if you have a non static ip... instead I would recommend using .htaccess to change the "index" to something other than index.php/.htm/.html (or whatever you are using) and then password protecting your entire site using htaccess.

Your "temporary" new index may be best in a subfolder and then allow access to that directory using htaccess.

Anyone who visits the general site www.......com will then see the temporary index, anyone who forcefully tries to go anywhere else or has a bookmark etc. with get a password prompt (which of failing or canceling you can redirect back to the temporary index)

On logging in the first time save your password and you wont have to keep entering it.

Simples.

Yours is easily as complex as everyone else's.

Personally, I would use a rewrite to serve up a site down page to any IP but your own. Who cares if his IP isn't static, they don't change unless his connection drops anyway. If it does, he can just change the IP in the htaccess file again.

Link to comment
Share on other sites

  • 0

Yours is easily as complex as everyone else's.

Personally, I would use a rewrite to serve up a site down page to any IP but your own. Who cares if his IP isn't static, they don't change unless his connection drops anyway. If it does, he can just change the IP in the htaccess file again.

You're assuming the OP is in a static location. He never said only his home pc can get to it. It may be a laptop, changing ip's frequently, yet still wants only his pc to access it.

What I do is a simple mac address and logged in user name of the pc lookup. If they both fail, redirect to offline page.

Link to comment
Share on other sites

  • 0

Use Apache's log in. You need a password to login and access the files. If you use the method suggested by +Cupcakes, what about accessing the files from other computers?

If the computers are on the same network, then they're utilizing the same IP address. Otherwise if you want other IP addresses to access the site you would just add another line of allow from followed by their IP address.

Link to comment
Share on other sites

  • 0

You're assuming the OP is in a static location. He never said only his home pc can get to it. It may be a laptop, changing ip's frequently, yet still wants only his pc to access it.

What I do is a simple mac address and logged in user name of the pc lookup. If they both fail, redirect to offline page.

I think it's a fair assumption, I'd be shocked if he did work from more than 2 locations.

You know we're talking about a web server, right? No browser sends either of those pieces of information (ActiveX is a piece of ****).

Link to comment
Share on other sites

  • 0

Edit with your ip below, stick the script inside the webroot htaccess file, and then anyone not on your ip will receive error 503 service unavailable

ErrorDocument 503 "Website down for maintenance" 
RewriteEngine On 
RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ 
RewriteRule .* - [R=503,L]

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.