5

I am writing some simple HTML pages. I need to protect some pages and some files (from being downloaded) by requiring a username and password. Does anyone know a simple solution?

MrWhite
  • 42,784
  • 4
  • 49
  • 90
Anand
  • 153
  • 3
  • 1
    What sort of webserver are you using? Apache? IIS? – paulmorriss May 10 '11 at 09:20
  • I don't know actually. I can connect to the server to upload my files there. Besides that, I don't think that I could have other access to the server. Thank you! – Anand May 10 '11 at 09:28
  • Do you want to use Netcraft as suggested in this question http://superuser.com/questions/120783/can-i-detect-what-webserver-a-website-is-using to work it out and then tell us the results. – paulmorriss May 10 '11 at 10:10
  • Here is the result: Thank you!

    HTTP/1.1 200 OK Date: Tue, 10 May 2011 10:14:35 GMT Server: Apache/2.0.52 (Red Hat) X-Powered-By: PHP/4.3.9 Connection: close Content-Type: text/html; charset=UTF-8

    – Anand May 10 '11 at 10:15
  • To make this question useful to other people I've answered it for people using IIS too. – paulmorriss May 10 '11 at 10:37

1 Answers1

5

First of all find out what sort of webserver you are using by using the method suggested in this question: https://superuser.com/questions/120783/can-i-detect-what-webserver-a-website-is-using

If it's Apache How do I setup authentication on a specific folder using .htaccess?

If it's IIS https://serverfault.com/questions/193273/iis-password-protection-for-php

paulmorriss
  • 15,371
  • 1
  • 38
  • 58