Need to allow encoded slashes on Apache

后端 未结 7 2008
我寻月下人不归
我寻月下人不归 2020-11-30 20:12

I\'m currently trying to place a URL within a URL. For example:

http://example.com/url/http%3A%2F%2Fwww.url2.com

I\'m aware that I have to

7条回答
  •  时光取名叫无心
    2020-11-30 20:53

    in light of all the hassles, i opted for base64_encoding followed by urlencoding. It works without having to fool around with apache server settings or looking at bug reports. It also works without having to put the url in the query section.

    $enc_url = urlencode(base64_encode($uri_string));
    

    and to get it back

    $url = base64_decode(urldecode($enc_url));
    

    http://example.com/admin/supplier_show/8/YWRtaW4vc3VwcGxpZXJz

    http://example.com/admin/supplier_show/93/YWRtaW4vc3VwcGxpZXJzLzEwMA%3D%3D

提交回复
热议问题