sawade Posted September 3, 2009 Share Posted September 3, 2009 I'm sure there must be away, but again I know nothing about how to write the .htaccess file. I have looked up tutorials and whatnot, but they all seem to be written in gibberish. In my file I have the following: <Files .htaccess> deny from all </Files> I was wondering if I can apply this same principle to other files? Example: Exclude error_log Exclude /folder1/folder2/filename Exclude /folder1/folder2/folder3/ (all files) I have this at the beginning of my file, if it helps... Options +FollowSymLinks # DISALLOW includes to execute code Options +includesNOEXEC # DISALLOW peek into directories without an index file Options -Indexes RewriteEngine On RewriteBase / AddHandler application/x-httpd-php5s .php Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/ Share on other sites More sharing options...
wildteen88 Posted September 3, 2009 Share Posted September 3, 2009 Place a .htaccess file in /folder1/folder2/ with the following code deny from all Now now one will be able to browse to any files/folders placed within yoursite.com/folder1/folder2/ Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/#findComment-911773 Share on other sites More sharing options...
sawade Posted September 7, 2009 Author Share Posted September 7, 2009 Place a .htaccess file in /folder1/folder2/ with the following code deny from all Now now one will be able to browse to any files/folders placed within yoursite.com/folder1/folder2/ I can't just keep it in the main directory and reference folders? Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/#findComment-914230 Share on other sites More sharing options...
sawade Posted September 9, 2009 Author Share Posted September 9, 2009 I tried this, but it made it so the website is not viewable at all. <Directory /> AllowOverride None </Directory> <Directory /> Order Deny,Allow Deny from all </Directory> <Directory /folder/folder> Order Deny,Allow Deny from all </Directory> UserDir disabled root Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/#findComment-915150 Share on other sites More sharing options...
trq Posted September 9, 2009 Share Posted September 9, 2009 This directive.... <Directory /> Order Deny,Allow Deny from all </Directory> Denies all access to / which is your servers root. Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/#findComment-915158 Share on other sites More sharing options...
sawade Posted September 10, 2009 Author Share Posted September 10, 2009 I tried changing the order to allow deny. Didn't work. For some reason if any of this 4 scripts are input the site is not viewable. Quote Link to comment https://forums.phpfreaks.com/topic/172952-solved-htaccess-deny-from-all/#findComment-916026 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.