NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page .httaccess

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 10-16-2006, 10:58 AM THREAD STARTER               #1 (permalink)
Account Closed
Join Date: Oct 2005
Location: United Kingdom
Posts: 1,554
NetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really nice
 



.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
NetworkTown.Net is offline  
Old 10-16-2006, 03:58 PM   #2 (permalink)
NamePros Member
Join Date: Nov 2005
Posts: 28
c0demonger is an unknown quantity at this point
 



create a .htaccess file under /templates/

and put:

Deny From All

it should work.
c0demonger is offline  
Old 10-16-2006, 06:42 PM   #3 (permalink)
If only you knew...
 
maximum's Avatar
Join Date: Oct 2005
Location: Inside your head...
Posts: 998
maximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond repute
 


Child Abuse Special Olympics Save a Life Baby Health Autism
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.
maximum is offline  
Old 10-17-2006, 12:35 PM THREAD STARTER               #4 (permalink)
Account Closed
Join Date: Oct 2005
Location: United Kingdom
Posts: 1,554
NetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really niceNetworkTown.Net is just really nice
 



and if i want to deny a whole directory then?
NetworkTown.Net is offline  
Old 10-17-2006, 12:48 PM   #5 (permalink)
If only you knew...
 
maximum's Avatar
Join Date: Oct 2005
Location: Inside your head...
Posts: 998
maximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond reputemaximum has a reputation beyond repute
 


Child Abuse Special Olympics Save a Life Baby Health Autism
Originally Posted by NetworkTown.Net
and if i want to deny a whole directory then?
<files *.*>
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.
maximum is offline  
Old 10-17-2006, 01:58 PM   #6 (permalink)
NamePros Member
Join Date: Nov 2005
Posts: 28
c0demonger is an unknown quantity at this point
 



although mine works most of the time (for me at least), maximum's solution is the proper way of doing it

thanks maximum.
c0demonger is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 05:58 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger