看到一个网站是这样处理图片链接的, 求解:
例如有图片, 名为: p979977364-4.jpg
如果输入: http://www.anhhuynh.com/cdn/pub/0h3htoeyrbvs/0/null/mh/7upcxhvl93fgm-0gnob3/s10/v2/p979977364-4.jpg
刚提示错误:the page cannot be displayed because an internal server error has occurred.
但如果在后面加上: ?ts=5&tk=t3fhdydpd0aqawv5exdzijxy1br6sxgus-4o-5vvvn8= 就可以打开了图片了.
有大侠知道这是如何实现的呢? (请就以这一样图片为例, 求思路)
------解决方案--------------------
这个不是加密吧,应该是普通的apache urlrewrite 技术。理由url 有 ? 和 & ,典型的靠url get。为了保证数据库安全,不让hack猜出它的数据库结构,做了个md5转换。lz可以用firebug找出它的真实地址。
真正的图片加密技术,应该是base64之类的。比如:data:image/gif;base64,r0lgodlhaqacalmaamxh96hr97xz98hf98xg97dx97nb98lf97vc98tg973d96ru97ba97%2fe96xs9waaach5baaaaaaalaaaaaababwaaaqvmlhvbdnitxesaurydi2cgixqle4eads%3d
------解决方案--------------------
他这应该用的是rewrite技术,比如p979977364-4.jpg可能会被解释成showimage.php?ts=5&tk=t3fhdydpd0aqawv5exdzijxy1br6sxgus-4o-5vvvn8=&pid=$1&type=$2
不过,他前面的/0h3htoeyrbvs/0/null/mh/7upcxhvl93fgm-0gnob3/s10/v2可能也是规则中被使用参数的一部分比如
rewriterul ^(.*)/cdn/pub/([a-z0-9a-z]+)/([0-9]+)/([a-z0-9a-z]+)/([a-z0-9a-z]+)/([a-z0-9a-z\-]+)/([a-z0-9a-z]+)/([a-z0-9a-z]+)/([a-z0-9a-z]+)-([a-z0-9a-z]+)\.jpg?ts=([0-9]+)&tk=([a-za-z0-9=\-]+) $1/cdn/pub/shoimage.php?p1=$2&p2=$3&p3=$4&p4=$5&p5=$6&p6=$7&p7=$8&p8=$9&p9=$10&ts=$11&tk=$12
