Now You Can Download Google Chrome OS for Free!
 

Restrict Access Using Htaccess on Windows

Filed in: Web Development — February 1st, 2005

advertisement

I wrote a simple web application for stock management to be used inside the company(by only a staff). I got a request to implement password protection to the system.

I do not want to modify database and modify the codes(and I am lazy :P ). So, the fastest way is to use .htaccess file to restrict access to the web directory.

However, Microsoft Windows does not support filename starts with a ‘dot’. How do we implement the .htaccess?!

I found a very good tutorial(with DETAILS explaination) for Apache .htaccess Authentication.

After reading the tutorial, the web system implemented password protection in just 5 minutes! :wink:

Thought:
Though Apache web server configuration file is plain text file, but it is VERY powerful if you dig it down. :)

Read also:

  • I have been writing .htaccess on Windows XP Notepad.

    In fact, I've just tested and it still works.
  • According to the link in the post, the author said Windows XP support filename with "dot" infront. However, it does not work for me.
  • Did you get system error? Hmm.Strange. Normally what I do is that after saving from a notepad, it would become .htaccess.txt

    I would then rename it to .htaccess manually.
  • the trick is choose "All files in the" file type or save as with the quote ".htaccess"
  • Thanks for the tip, farking! Found that we cannot rename a file to .htaccess, but "Save as..." works. :)
blog comments powered by Disqus