站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Htaccess for subdirectories
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== 使用.htaccess保护单个的目录== One possible solution for this problem is provided by .htaccess. You can add a .htaccess file to any directory that requires lenient permissions settings (such as 760, 766, 775 or 777). You can prevent the execution of scripts inside the directory and all its sub-directories. You can also prevent any files other than those of a certain type to be written to it. .htaccess提供了一种解决问题的方法。你可以向任何需要较宽松的权限设置(如760,766,775或者777)的目录,添加.htaccess文件。你可以阻止目录和所有的子目录中的,脚本的运行。你也可以禁止除了某个类型之外的其它文件的写权限。 The following snippet of code prevents any files other than .jpeg, .jpg, .png. or .gif to be uploaded to the directory: 下面是一小片代码,阻止除了.jpeg, .jpg, .png. 或者 .gif的任何文件,上传到目录上: <pre> <Files ^(*.jpeg|*.jpg|*.png|*.gif)> order deny,allow deny from all </Files> </pre> <pre> <Files ^(*.jpeg|*.jpg|*.png|*.gif)> order deny,allow deny from all </Files> </pre> The following code will prevent .pl, .cgi or .php scripts from being executed; instead, they will display as plain text inside the browser window: 下面的代码阻止运行.pl, .cgi 或者 .php 脚本;这些脚本会在浏览器窗口中显示为纯文本: <pre> AddType text/plain .pl AddType text/plain .cgi AddType text/plain .php </pre> <pre> AddType text/plain .pl AddType text/plain .cgi AddType text/plain .php </pre> Here's another way to display scripts as plain text instead of executing them: 下面还有一种方式,可以较脚本显示为纯文本,不用运行这些脚本: <pre> RemoveHandler cgi-script .pl .py .cgi </pre> <pre> RemoveHandler cgi-script .pl .py .cgi </pre> The following code categorizes all files that end in certain extensions so that they fall under the jurisdiction of the -ExecCGI command (removes the ability to execute scripts), which also means -FollowSymLinks. 下面的代码,为带有某个扩展名的所有文件分类,这样这些文件就归属-ExecCGI命令的权限(就不能够运行脚本),也意味着-FollowSymLinks。 <pre style="font-size: 0.92em;"> AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi Options -ExecCGI </pre> <pre style="font-size: 0.92em;"> AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi Options -ExecCGI </pre> ''Please note:'' From a security standpoint, even a small amount of protection is preferable to a world-writeable directory. Try less permissive settings like 766, then 775 and only use 777 if necessary. Make sure that the .htaccess file itself has a chmod of 644. ''请注意:''从安全的角度来看,即使是少量的包含,对于world-writeable目录,也是可取的。试试较低的权限设置,如766,755,如果必要的话,就使用777。确定.htaccess文件自身的权限是644。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)