apache伪静态中文urlencode重写时403错误解决方法
来源:互联网 发布:矩阵卷积运算 编辑:程序博客网 时间:2024/06/03 21:38
本人最近在开发商城网站,并对url进行了重写,重写后的链接是
在nginx的重写规则是rewrite ^/search-([0-9]+)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-(.*)\.html$ /index.php?app=search&cate_id=$1&keyword=$2&brand=$3&order=$4&show_method=$5&page=$6&approve_num=$7&price=$8 last;
有如下一个链接,我在nginx重写中访问没有问题,但是在Apache下访问就报错
http://local.wksc.com/search-1071-0-%B4%EF%BF%CB%C4%FE-1-2-0-0-0.html
报错是:Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
但是把链接中的%B4%EF%BF%CB%C4%FE部分替换为数字就可以,
而这(%B4%EF%BF%CB%C4%FE)部分是中文"达克宁"的urlencode结果
在nginx的重写规则是rewrite ^/search-([0-9]+)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-([^-]*)-(.*)\.html$ /index.php?app=search&cate_id=$1&keyword=$2&brand=$3&order=$4&show_method=$5&page=$6&approve_num=$7&price=$8 last;
有如下一个链接,我在nginx重写中访问没有问题,但是在Apache下访问就报错
http://local.wksc.com/search-1071-0-%B4%EF%BF%CB%C4%FE-1-2-0-0-0.html
报错是:Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.
但是把链接中的%B4%EF%BF%CB%C4%FE部分替换为数字就可以,
而这(%B4%EF%BF%CB%C4%FE)部分是中文"达克宁"的urlencode结果
据我猜测应该是Apache的url重写不支持中文,这个怎么弄?或者是安全因素?
后来参考了一篇博客找到了答案
Apache rewrite规则中如果遇到中文,相当有可能会出现乱码问题,因为apache在rewrite时会做一次url解码,进行请求转发时,就不会再是编码后的字符串了。此种情况,可以在一开始就进行两次编码(encode),
- apache伪静态中文urlencode重写时403错误解决方法
- APACHE通过URL重写伪静态 【转】
- 伪静态 url 重写 apache linux
- APACHE通过URL重写伪静态
- apache配置伪静态实例 重写技术
- 通过Apache的URL地址重写(附伪静态方式)
- 如何通过apache的重写机制实现 伪静态?
- Ecshop url重写 apache环境配置伪静态
- apache启用rewrite重写模块配置伪静态
- apache中配置PHP伪静态Rewrite重写
- apache如何实现伪静态(URL重写)功能?
- 利用apache伪静态规则重写lighttpd伪静态规则的方法
- apache 开启 rewrite 重写规则 apache 目录 htaccess rewrite 重写规则 (伪静态)
- URL 重写,伪静态
- URL 伪静态重写
- url伪静态 重写
- 伪静态 URL 重写
- IIS web.config url重写伪静态规则错误
- 《C预处理》linux kernel中一种宏定义在函数实现中的用法
- ASP.Net中实现中英文复合检索文本框
- ptyhon读文件一行长度len为1022,出现\x00
- 使用PHP+JQuery+Ajax分页的实现
- shell string字符串操作
- apache伪静态中文urlencode重写时403错误解决方法
- linux的sh脚本编程
- 关于线程分离状态
- C语言简单示例(文件读写4)
- ZOJ 3626 Treasure Hunt I(树形DP)
- android中usb设备驱动不能自动创建设备节点
- Go: channel meet range
- mysql 按年度、季度、月度、周、日SQL统计查询
- Ubuntu搭建Android开发环境