V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
hippoboy
V2EX  ›  PHP

最近学习使用 CodeIgniter 这个框架,遇到一个 router 使用 urlcode 的问题

  •  
  •   hippoboy · 2016-10-13 14:59:18 +08:00 · 1437 次点击
    这是一个创建于 2765 天前的主题,其中的信息可能已经有所发展或是发生改变。
    举个栗子:

    我使用 /index.php/test/test 可以正常访问

    /index.php%2ftest%2ftest 却不正常,返回 404Object not found!

    我不知道是哪里出了问题?我的环境是 Ubuntu+Nginx

    请指教,谢谢.
    4 条回复    2016-10-13 15:14:38 +08:00
    inmyfree
        1
    inmyfree  
       2016-10-13 15:02:34 +08:00
    本来就是, /index.php/test/test 访问的是 index.php 文件

    但是 /index.php%2ftest%2ftest 访问的是 index.php%2ftest%2ftest 文件
    enenaaa
        2
    enenaaa  
       2016-10-13 15:05:42 +08:00   ❤️ 1
    你为什么会以为 %2f 应该自动转码为'/' ?
    hippoboy
        3
    hippoboy  
    OP
       2016-10-13 15:14:03 +08:00
    @inmyfree 恍然大悟,感谢
    hippoboy
        4
    hippoboy  
    OP
       2016-10-13 15:14:38 +08:00
    @enenaaa 原来不能自动转码...恕我无知:-)....
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3379 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:00 · PVG 20:00 · LAX 05:00 · JFK 08:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.