This is a discussion on "restricting access to folders on server" within the PHP Forum section. This forum, and the thread "restricting access to folders on server are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
restricting access to folders on server
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
restricting access to folders on server
i am using apache server and presently when i try accessing any folders of my website i am able to
browse the files ex = www.website.com/images which is a serious security risk as i am building a forum website using php and mysql. in the root directory i have created a .htaccess file and whenever someone access a file which is not on the server i have created a user friendly message that the file does not exist instead of a 404 error message displayed by the browser. similar to this how can i go about restricting users to browse all my folders in the toot directory. if anyone accesses for ex = www.website.com/phpscripts an alert should appear asking them to enter a username and password. 1. how can i do this using apache. 2. where do i write the username and password information and will this apply to all the folders in the root directory or specific directories. please advice. thanks. |
|
|
|
|||
|
Re: restricting access to folders on server
Use .htaccess or disable directory viewing from your Cpanel.
Last Blog Entry: Cross browser nuisance (Feb 11th, 2008)
|
|
||||
|
Re: restricting access to folders on server
Following on from Rohan, this article on .htaccess password protection should help you out
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
|
|
|||
|
Re: restricting access to folders on server
I have set up a password protected directory following those instructions, but how can I access files inside that directory using PHP?
Edit: Never mind, I was trying to access an image file inside the folder and seems this is not possible. Last edited by djeyewater; Mar 30th, 2008 at 19:01. Reason: Found answer |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [SOLVED] How do I access my web server from the command line? | MikeHopley | Other Programming Languages | 5 | Jan 18th, 2008 15:35 |
| Making the form Secure & Restricting Chars | PicoDeath | PHP Forum | 3 | Aug 2nd, 2007 20:00 |
| How do you made folders that are... | simonb | Webforumz Cafe | 9 | Jul 25th, 2007 21:12 |
| Passwords - restricting access to the webpage or parts of it | pengyou | Starting Out | 5 | May 24th, 2007 11:38 |