hippoboy
V2EX  ›  PHP

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

  •  
  •   hippoboy · Oct 13, 2016 · 2101 views
    This topic created in 3686 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
    inmyfree
    Oct 13, 2016
    1
    本来就是, /index.php/test/test 访问的是 index.php 文件

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