# Password protecting a web page

**URL:** <https://boards.straightdope.com/t/password-protecting-a-web-page/712293>\
**Category:** Factual Questions\
**Created:** [February 10, 2015, 1:37pm UTC](https://boards.straightdope.com/t/password-protecting-a-web-page/712293 "2015-02-10T13:37:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Saint\_Cad](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/saint_cad/32/18907_2.png) [@Saint\_Cad](https://boards.straightdope.com/u/Saint_Cad)\
**Post date:** [February 10, 2015, 1:37pm UTC](https://boards.straightdope.com/t/password-protecting-a-web-page/712293/1 "2015-02-10T13:37:08Z")

</div>

I am designing a website and for the first time I need to add password protection to certain pages e.g. John Dough needs to have the password to access jdough.html . I was looking online and I see a lot of references to .htaccess . Is that still the standard way to add password protection? Are there better (& standard) ways to do this in 2015? And I am planning on taking the person’s password, add a seed and hash it with RSA256 and store THAT as the password so I don’t know if that makes a difference.

---

<div class="post-metadata">

**Author:** ![jovan](https://avatars.discourse-cdn.com/v4/letter/j/0ea827/32.png) [@jovan](https://boards.straightdope.com/u/jovan)\
**Post date:** [February 10, 2015, 2:04pm UTC](https://boards.straightdope.com/t/password-protecting-a-web-page/712293/2 "2015-02-10T14:04:02Z")

</div>

In Apache, the preferred approach is to set the access rules in configuration files, if possible.

[https://docs.oracle.com/cd/B14099\_19/web.1012/q20206/howto/htaccess.html#when](https://docs.oracle.com/cd/B14099_19/web.1012/q20206/howto/htaccess.html#when)

However, in many cases you may not have access to those files. This is when you have to rely on .htaccess.
