Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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

2 Answers 2

Try HTTP Authentication

share|improve this answer

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

Your Answer

 
discard

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