0

I checked this Links..

Protect folder with password fails on localhost (under Apache and Windows)

in this the solution is to execute the project using a password but i only want to protect php program folder from direct access.

I don't want password authentication while php program execution.

1 Answers1

0

Create a .htaccess file in the directory which you want to protect from direct access. The .htaccess file contains the following code: Options -Indexes

lovelace
  • 1,195
  • 1
  • 7
  • 10
  • Sir, please elaborate, idon't know much about htaccess file – Arun Rappai C Sep 27 '17 at 04:31
  • Sure, a .htaccess file is a config file for use on web servers running Apache. When you put a .htaccess file in a directory (in your case the directory which you want to protect), the .htaccess file gets detected and executed by Apache web server (www.htaccess-guide.com) – lovelace Sep 27 '17 at 06:19
  • It's as easy as opening a new file in e.g. notepad, enter: Options -Indexes and save the file in the directory you want to protect as .htaccess (do not forget the leading period '.' in .htaccess) – lovelace Sep 27 '17 at 06:25
  • Sir, i have done this, but now also any one can edit my code..but i don't want that happen, Could you please give a solution for this. – Arun Rappai C Sep 27 '17 at 07:58
  • Hi, add the following to your .htaccess file: `deny from all` this should bar access to any file in the directory. – lovelace Sep 27 '17 at 19:58