| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| Account Closed Join Date: Oct 2005 Location: United Kingdom
Posts: 1,554
![]() ![]() ![]() ![]() | .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... Join Date: Oct 2005 Location: Inside your head...
Posts: 998
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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 greatest truths ever told, and the greatest lies ever told, all consist of exactly the same three words: "I LOVE YOU" --- The best say little, only say what is important.....then they shut up and sit down.
Last edited by maximum; 10-16-2006 at 06:48 PM.
|
| |
| | #5 (permalink) | ||||
| If only you knew... Join Date: Oct 2005 Location: Inside your head...
Posts: 998
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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:????: NamePros.com http://www.namepros.com/programming/247855-httaccess.html ErrorDocument 403 http://yoursite.com/AccessDenied.html Hope this helps
__________________ --- The greatest truths ever told, and the greatest lies ever told, all consist of exactly the same three words: "I LOVE YOU" --- The best say little, only say what is important.....then they shut up and sit down.
Last edited by maximum; 10-17-2006 at 01:02 PM.
| ||||
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |