htaccess on shared hosting

Soldato
Joined
1 Feb 2006
Posts
8,188
Hi

I have some shared hosting and am developing a few sites presently for some mates. I want to hide my database access files in the filesystem without putting them near my public_html folder. My host cant give me access to the httpd.conf files so I was wondering if i can still include a path to a hidden file containing a script to define server environment variables which I can then use to connect to my database. Is this possible using htaccess or a php.ini file or something like that? Really am a noob when it comes to all that jazz.

Have had a google but they all refer to examples where it isn't shared hosting and where one has access to the httpd.conf files.

Thanks in advance

Jonny
 
you can use php_value in your htaccess to set any setting just as if you had access to php.ini it's self -assuming your host supports it (any paid hosting should)

i use it to set an includes directory outside my webroot as well.....

Code:
php_value include_path ".:/users/m/marc2003/includes"
 
thanks for that - where abouts should my htaccess file be located or can you have multiple files in different directories? Can I create folders anywhere outside the public_html folder which I can store includes files in? Thanks
 
i guess you could use multiple files - i just have one .htaccess at the root of my website folder and one includes directory outside of it.
 
Back
Top Bottom