如何编辑.htaccess文件,拒绝盗链到的.css,.inc文件? [英] How can I edit the .htaccess file to deny hotlinking to .css, .inc files?

查看:177
本文介绍了如何编辑.htaccess文件,拒绝盗链到的.css,.inc文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上一个名为functions.inc文件我的功能。我如何可以直接进入 http://example.com/functions编辑.htaccess文件拒绝用户查看它。公司


解决方案

 <文件〜\\ $。公司>
为了允许,拒绝
所有拒绝
< /文件>

有用的,如果你没有安装mod_rewrite的事情。

I have my functions in a file called functions.inc in my website. How can I edit the .htaccess file to deny users from viewing it by directly going to http://example.com/functions.inc

解决方案

<Files ~ "\.inc$">
Order allow,deny
Deny from all
</Files>

Useful if you don't have mod_rewrite installed.

这篇关于如何编辑.htaccess文件,拒绝盗链到的.css,.inc文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆