Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I make certain pages only viewable by me? For example, let's say I own mydomain.com, and I want to be the only one that can see mydomain.com/mypage.php.

I tried changing the permissions of the file to 700, but then I just get a 'you don't have permission' error when I try to access it.

Any ideas?

share|improve this question

migrated from stackoverflow.com Sep 8 '11 at 23:19

This question came from our site for professional and enthusiast programmers.

Htaccess Authentication comes to mind – Dagon Sep 8 '11 at 21:56

Changing the permissions on the file just keeps the webserver from being able to access it, which means NO ONE can access it at all. If you want to restrict it to just yourself, add a login (http basic authentication), add some IP filtering, then hide the script in a directory with a very non-guessable name and don't refer to it from any "public" page where its existence could be revealed.

share|improve this answer
More detail on how to do it here: webmasters.stackexchange.com/questions/13580/… – paulmorriss Sep 9 '11 at 11:32

Try HTTP Authentication

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.