We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,376 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Making a Folder Inaccessible for users [Apache, PHP, XAMPP]

But the problem is: There a File names "includes" which includes the php files which have been included in some of the php files outside of it. But I want to lock/ make it inaccessible for users. Is it possible that the users can't access the folder/directory but the php files can? Well, Now I am testing my website on XAMPP, but I have plans to shift it to a web server. So, please answer so that I can my website more secure.

Thanks in Advance! :)

2
Contributors
3
Replies
5 Hours
Discussion Span
1 Year Ago
Last Updated
4
Views
AbhishekBiswal
Newbie Poster
9 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

You can use .htaccess:

order deny,allow
deny from all

put this file inside the folder to protect and no one can access from the web. Source: http://httpd.apache.org/docs/2.2/howto/access.html

bye :)

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

You can use .htaccess:

order deny,allow
deny from all

put this file inside the folder to protect and no one can access from the web. Source: http://httpd.apache.org/docs/2.2/howto/access.html

bye :)

Yeah It works, but the main page and other pages which include the files inside the blocked directory/folder are unable to access them. The Files can't Access CSS, PHP Files can't access the header.php and footer.php files ( they are inside the blocked directory ) Plz Help!

AbhishekBiswal
Newbie Poster
9 posts since Sep 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Explain better which files you want to limit access. Because CSS files can't be stored on that kind of directory.

And post a portion of code where you include the header.php that doesn't now work. So we can see what is happening. To include a file from that directory you should write something like this:

include('/path/to/file/header.php');

where the path is the server root, not an url. Bye :)

cereal
Veteran Poster
1,146 posts since Aug 2007
Reputation Points: 344
Solved Threads: 223
Skill Endorsements: 22

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.3139 seconds using 2.67MB