V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
hippoboy
V2EX  ›  PHP

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

  •  
  •   hippoboy · Oct 13, 2016 · 1818 views
    This topic created in 3483 days ago, the information mentioned may be changed or developed.
    举个栗子:

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

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

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

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

    但是 /index.php%2ftest%2ftest 访问的是 index.php%2ftest%2ftest 文件
    enenaaa
        2
    enenaaa  
       Oct 13, 2016   ❤️ 1
    你为什么会以为 %2f 应该自动转码为'/' ?
    hippoboy
        3
    hippoboy  
    OP
       Oct 13, 2016
    @inmyfree 恍然大悟,感谢
    hippoboy
        4
    hippoboy  
    OP
       Oct 13, 2016
    @enenaaa 原来不能自动转码...恕我无知:-)....
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3029 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 00:02 · PVG 08:02 · LAX 17:02 · JFK 20:02
    ♥ Do have faith in what you're doing.