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

nginx 配置文件写法导致 s 开头的 url 页面都是 404

  •  
  •   zijian · Feb 10, 2020 · 2075 views
    This topic created in 2268 days ago, the information mentioned may be changed or developed.
    在 wordpress (网站域名:sample.com ) 二级目录安装了另一个程序( s ),默认域名(同时也是目录)就是: sample.com/s, 现在想给二级目录这个程序开启伪静态,在 nginx 配置文件「 sample.com.conf 」填写的 include s.conf,s.conf 里是这样写的:

    location /s {

    ......
    }

    配置好重启 nginx 后,sample.com/s 的伪静态是有了,但是 sample.com 里凡是 sample.com/s 开头的页面都是 404,我的 s.conf 的“location /s”是不是哪里写的有问题,哪位懂的请指点一二,谢谢!
    5 replies    2020-02-12 16:35:15 +08:00
    xmlf
        1
    xmlf  
       Feb 10, 2020 via Android
    那还是伪静态不成功。都 404 了,没跳转成功
    2wex
        2
    2wex  
       Feb 11, 2020
    `location /s` 的里面是不是写错了

    盲猜 你应该把`/index.php`改成`/s/index.php`
    Tezos
        3
    Tezos  
       Feb 11, 2020
    为什么不用二级域名而是二级目录
    mauve
        4
    mauve  
    PRO
       Feb 11, 2020 via iPhone   ❤️ 1
    /s 改为 /s/
    zijian
        5
    zijian  
    OP
       Feb 12, 2020
    @mauve 成功了,就是写的有问题,改成 /s/就可以了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1137 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 23:06 · PVG 07:06 · LAX 16:06 · JFK 19:06
    ♥ Do have faith in what you're doing.