jeff5656 Posted May 24, 2011 Share Posted May 24, 2011 If you use htaccess to restrict a directory can you still use the include function to include a file from that directory? Quote Link to comment https://forums.phpfreaks.com/topic/237282-include-for-protected-directroy/ Share on other sites More sharing options...
anupamsaha Posted May 24, 2011 Share Posted May 24, 2011 Yes. You can. I have done this and sure about it. What's the issue that you are facing? Quote Link to comment https://forums.phpfreaks.com/topic/237282-include-for-protected-directroy/#findComment-1219383 Share on other sites More sharing options...
jeff5656 Posted June 2, 2011 Author Share Posted June 2, 2011 So I can have a php page inside a public directory that includes a file from an htaccess-protected directory? And the public user will be able to read that included file, but if they try to access it directly from the protected directory they will not be able to? (That is what I am hoping). Quote Link to comment https://forums.phpfreaks.com/topic/237282-include-for-protected-directroy/#findComment-1223838 Share on other sites More sharing options...
jcbones Posted June 2, 2011 Share Posted June 2, 2011 Yes, as the included file is not fetched via HTTP. If your .htaccess file is a deny/all, then it will drop all HTTP request. Quote Link to comment https://forums.phpfreaks.com/topic/237282-include-for-protected-directroy/#findComment-1223841 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.