htaccess on connections folder

Web hosting discussion, programming, and shared and dedicated servers.
2 posts Page 1 of 1
by motsat » Tue Dec 27, 2011 2:58 pm
Basic question -- if I put htaccess with htpasswd on the folder that contains my MySQL connection information, will my pages still be able to access the database? My goal is to prevent outside users from viewing the connection string. Also, any other advice on securing the MySQL database would be helpful. Thanks!
by thulsa_doom » Fri Dec 30, 2011 5:30 pm
Generally speaking just keep their database credentials in a .php file that doesn't actually output the information itself. When somebody attempts to access the file through the web server, the web server executes whatever the PHP says, never actually exposing the credentials to the outside world. The default directory permissions for a Sonic.net web directory should prevent others from reading your files in other contexts (such as via a shell interface or FTP).
John Fitzgerald
Sonic Technical Support
2 posts Page 1 of 1

Who is online

In total there are 20 users online :: 0 registered, 0 hidden and 20 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 20 guests