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条)

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services