| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Account Closed | .httaccess Hi How do i block people from seeing the following file: /home/user/public_html/template/main.tpl OR http://www.domain.com/template/main.tpl I need to .httaccess code for it please thanks. Thanks |
| |
| | #3 (permalink) |
| If only you knew... | c0demonger's suggestion (Thanks for trying to help, however ), is not complete, and a straight "deny from all" directive would prevent all files in the folder from being viewed. Try this in its folder:<files main.tpl> order allow,deny deny from all </files> This prevents its direct viewing, but allows your other scripts to access it.
__________________ The smartest thing I ever did for my future was to start taking life seriously. The smartest thing I ever did for my present was to stop taking life so seriously Last edited by maximum; 10-16-2006 at 05:48 PM. |
| |
| | #5 (permalink) | |
| If only you knew... | Quote:
order allow,deny deny from all </files> ErrorDocument 403 "Access Denied to this file! Denies direct access via browser to all files within the folder that have a "." and a file extention in the name (unless you are doing something funny, all files). Note the line: ErrorDocument 403 "Access Denied to this file. only has one " - This is normal, on most configurations. Leaving it out, you get a server error. Adding another " to the end, and the second one shows at the end of the sentence. This line is NOT neccessary at all (could be added in protecting one file, as my first reply was about, or blocking whole directory, by the way ) Basically, any "blocked" file they attempt to access directly in browser, just gives them that sentence when they try viewing the URL. Replacing the line with a URL would send them to that URL instead:ErrorDocument 403 http://yoursite.com/AccessDenied.html Hope this helps
__________________ The smartest thing I ever did for my future was to start taking life seriously. The smartest thing I ever did for my present was to stop taking life so seriously Last edited by maximum; 10-17-2006 at 12:02 PM. | |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |