全球主机交流论坛

标题: nginx301问题 [打印本页]

作者: hxuf    时间: 2021-5-5 00:27
标题: nginx301问题
想法

a.com/*.html

重定向为

a.com/1/*.html

也就是放到目录里。然后访问a.com。就是正常首页。

搞了一整天了就是搞不定。
作者: xfspace    时间: 2021-5-5 00:34
try_files $uri /1/$uri/ /index.php;
作者: hxuf    时间: 2021-5-5 00:45
xfspace 发表于 2021-5-5 00:34
try_files $uri /1/$uri/ /index.php;

没有解决,还是会重定向到首页

感觉要放弃了
作者: skyindreams    时间: 2021-5-5 01:06
a.com/*.html
301后
a.com/1/$1.html
作者: seafood_to    时间: 2021-5-5 01:14
本帖最后由 seafood_to 于 2021-5-5 01:15 编辑

    if (!-e $request_filename) {
        rewrite ^(.*)$ /1/$1 last;
    }
作者: seafood_to    时间: 2021-5-5 01:19
hxuf 发表于 2021-5-5 00:45
没有解决,还是会重定向到首页

感觉要放弃了

你根目录不能有index.html/php文件啊




欢迎光临 全球主机交流论坛 (https://mjj.022333.xyz/) Powered by Discuz! X3.4