对于我的 codeigniter 应用程序中的所有页面,除了我的默认控制器,main.php
当我刷新浏览器时,url 不会像预期的那样受到影响。
但是,当我在“http://localhost/main”刷新浏览器时,该main
部分会从 url 中删除。所以浏览器栏只显示“http://localhost”。
完全不知道从哪里开始,但只是想知道是否有人以前遇到过这个......?
这就是我认为可能是我的 nginx.conf 的相关部分(如果 Nginx 是问题)。
if ($request_uri ~* ^(/main(/index)?|/index(.php)?)/?$)
{
rewrite ^(.*)$ / permanent;
}
请注意,将括号中的代码更改为:
rewrite ^(.*)$ /main permanent;
导致错误消息The webpage at http://localhost/main has resulted in too many redirects.