分页: 68/122 第一页 上页 63 64 65 66 67 68 69 70 71 72 下页 最后页 [ 显示模式: 摘要 | 列表 ]

在WIN下用ISAPI_REWRITE配制防盗链 不指定

root , 2008/05/22 20:58 , Windows , 评论(0) , 阅读(5921) , Via 本站原创
一、下载ISAPI_REWRITE并安装
二、修改httpd.ini
引用

RewriteCond Host: (img\.abc\.cn)
RewriteCond Referer: (?!http://\1.*).*
RewriteCond Referer: (?!http://(?:.*\.baidu\.com|baidu\.com|.*
\.google\.net|google\.net|.*\.sohu\.com|sohu\.com)).+
RewriteRule .*\.(?:jpg|gif|bmp) /block.gif [I,O,N]

三、上传/block.gif文件到在虚拟主机img.abc.cn站点根目录下.
四、在IIS中修改?block.gif属性->http头->启用内容失效->立即过期
五、重启IIS完毕。
注:当从限制访问到允许访问,发现在IE下可以立即过期,firefox就不行。

CodeIgniterURL中去掉index.php规则 不指定

root , 2008/05/22 20:53 , PHP , 评论(0) , 阅读(5891) , Via 本站原创
第一步,修改httpd.conf

修改成:

作用是开启.htaccess功能。
在站点目录下新建.htaccess文件(window下不能直接创建,得先在记事本编辑好再保存为.htaccess)
方案一
引用

RewriteEngine on
RewriteCond $1 !^(index\.php|public|tmp|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]

方案二
引用

RewriteEngine on
RewriteOptions Inherit
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]

重启apache搞定。
分页: 68/122 第一页 上页 63 64 65 66 67 68 69 70 71 72 下页 最后页 [ 显示模式: 摘要 | 列表 ]