I've been told it's wise to use .htaccess to block users from viewing .sql files etc. Looking for advice on this. If I block user access, will this affect my admin-side ability to write to sql? If so, can I use .htaccess to provide an exception for my admin-side?
Generally, there should never be a
.sql file stored in the document root directory. There are a few reasons for this, but mainly because these files leak information about the database(s) in your environment.
Blocking users seeing those files will not inhibit your ability to perform administrative tasks on your server. However, I should stress that those files should not be present in the first place, so blocking them would not gain anything.