password protect databases using .htaccess

5 replies
does anyone know some quick code to password protect a database using the .htaccess file. I had a script but i cant find it thanks
#databases #htaccess #password #protect
  • Profile picture of the author mywebwork
    Aloha wealthmaker2008

    I just Googled ".htaccess password protect" and found several good articles about doing this. One that seemed to lay it all out in an easy to understand fashion was at "cs.dal.ca/studentservices/faq/tutorials/web_sites/htaccess.shtml"

    Hope this helps

    Bill
    {{ DiscussionBoard.errors[408034].message }}
  • Profile picture of the author greenexit
    Originally Posted by wealthmaker2008 View Post

    does anyone know some quick code to password protect a database using the .htaccess file. I had a script but i cant find it thanks
    Hmm... I thought .htaccess was security directories. Didnt know it can secure a database.
    {{ DiscussionBoard.errors[433083].message }}
    • Profile picture of the author Bruce Hearder
      Could you give an example of what you want to achieve in protecting the database?

      Becuase .htacess might not be the best line of attack

      Take care

      Bruce
      {{ DiscussionBoard.errors[440851].message }}
  • Profile picture of the author Spencer Westwood
    What type of database? Flat files - yes can be protected with htaccess
    sqlite - yes can be protected. Mysql/postresql/mssql/oracle etc... should not need protecting that way and usually have their own login/passwd system.

    Kind regards, Spencer
    {{ DiscussionBoard.errors[443806].message }}
    • Profile picture of the author Matt Fulger
      Originally Posted by Spencer Westwood View Post

      What type of database? Flat files - yes can be protected with htaccess
      sqlite - yes can be protected. Mysql/postresql/mssql/oracle etc... should not need protecting that way and usually have their own login/passwd system.

      Kind regards, Spencer
      I agree with Spencer.

      In fact, I had a script that was using .htaccess to protect the mysql database and it was a MAJOR headache. Everytime you click on ANY link, you would have to sign back into the site.

      I'm not sure if this is normal or a bug in the script, but I don't use it anymore because of the problems I had with it protecting mysql with .htaccess.

      Peace & Prosperity,
      Matt Fulger
      {{ DiscussionBoard.errors[443878].message }}

Trending Topics