: Deny access to a folder on hosting server but serve the pages My hosting server allows to host multiple websites. The directory structure is like this root |_ www.a.com |_ www.b.com |_ www.c.com
My hosting server allows to host multiple websites.
The directory structure is like this
root
|_ a.com |_ b.com |_ c.com |_ d.com
I want to put some PHP files on the d.com folder so if some one browse the site from web-browser can get it, but no one can get it's source code [even by loggin in to the root folder].
Is there any way to doing so ?
There is a feature called Password protect folder or so, can in help in this case ?
More posts by @Sent6035632
2 Comments
Sorted by latest first Latest Oldest Best
I suspect "Password protect folder" puts a password on for people using web browsers. I think the best way to achieve this is to have separate ftp logons for the directories for a.com, b.com and c.com. Then only you, with access to the root, have access to the files for d.com. You could make the passwords the same so that people only have to remember one password.
PHP is executed on the server so if someone pulls up a PHP file in their browser the PHP will always execute and users will only ever see the output it creates. If you can see PHP code in your browser you either have a coding error or Apache is not set up properly.
If you want to make sure no one can see the files listed in these directories but still pull up the web pages, you can do that easily with .htaccess:
Options -Indexes
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.