Home » Categories » Business » Web Development

How to prevent access to a specific file on server using htaccess?

If you want to block with the file name abc.jpg, the followig htaccess code will prevent the viewing of this file.
# prevent access of a certain file

<files abc.jpg>
order allow,deny
deny from all
</files>
Put this code in your .htaccess file.
Attachments Attachments
There are no attachments for this article.
Comments Comments
There are no comments for this article. Be the first to post a comment.
Related Articles RSS Feed
CSS Positioning - Absolute, Relative & Fixed
Viewed 1153 times since Thu, Dec 3, 2009
How to redirect an old domain to a new domain using htaccess?
Viewed 447 times since Sun, Mar 14, 2010
Review of Mobile Web Application Frameworks
Viewed 920 times since Mon, May 9, 2011
Web Application Security Tools & Scanner Applications
Viewed 1544 times since Mon, Mar 22, 2010
Getting Pre-Authorized for a Mortgage Mortgage
Viewed 516 times since Mon, Jul 4, 2011
Google Skipfish - Web Application Security Scanner
Viewed 853 times since Mon, Mar 22, 2010
Search Engine Optimization: Tags of Importance for SEO
Viewed 390 times since Tue, Oct 12, 2010
Stylish Cross-Browser CSS Buttons - Simply-Buttons v2
Viewed 1409 times since Thu, Nov 12, 2009
Free Visualization Components For Flex (AS3)
Viewed 814 times since Sun, Jan 3, 2010