dongque1958 2011-08-30 07:30
浏览 67
已采纳

使用url重写后,base64编码给我带来了奇怪的结果

I have a really strange problem

ok the problem is thus

let say I have this url

http://www.example.com/?file=WFS010C.part3.rar&url=http://www.fileserve.com/file/vEpByp3/WFS010C.part3.rar

If I do base64_encode($_GET['url'])

the results is this

aHR0cDovL3d3dy5maWxlc2VydmUuY29tL2ZpbGUvdkVwQnlwMy9XRlMwMTBDLnBhcnQzLnJhcg==

after applying this rewrite condition

RewriteEngine On
RewriteBase /
RewriteRule ^file-(.*)-(.*)\.html$ index.php?file=$1&url=$2

The url is like this

http://www.example.com/file-WFS010C.part3.rar-http://www.fileserve.com/file/vEpByp3/WFS010C.part3.rar.html

now if I do base64_encode($_GET['url'])

the results is this

aHR0cDovd3d3LmZpbGVzZXJ2ZS5jb20vZmlsZS92RXBCeXAzL1dGUzAxMEMucGFydDMucmFy

**Note that the value of $_GET['url'] is exactly the same in both cases if printed without encoding!!!!

how come same string giving different results just after using rewrite ?**

Does anyone know whats the problem

  • 写回答

3条回答 默认 最新

  • duanmou9228 2011-08-30 07:40
    关注

    You can use base64_decode to see whether they are same.

    In fact:

    The first one is http://www.fileserve.com/file/vEpByp3/WFS010C.part3.rar

    And the second one is http:/www.fileserve.com/file/vEpByp3/WFS010C.part3.rar

    You can see, they are not same.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记