Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vue.js/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Redirect 从127.0.0.1重定向到localhost_Redirect_Localhost_Url Redirection - Fatal编程技术网

Redirect 从127.0.0.1重定向到localhost

Redirect 从127.0.0.1重定向到localhost,redirect,localhost,url-redirection,Redirect,Localhost,Url Redirection,我正在ubuntu系统上的localhost上运行一个项目。当我使用localhost或127.0.0.1时,它运行得很好。(即-loclhost/myproject或127.0.0.1/myproject)。当我使用localhost/myproject并导航到其他页面(比如“联系我们”页面)时,它会重定向到127.0.0.1/myproject/contactus。这不是问题,因为它正确显示页面 当我尝试使用localhost在另一个ubuntu系统上运行相同的项目时,出现了一些问题。当我尝

我正在ubuntu系统上的localhost上运行一个项目。当我使用localhost或127.0.0.1时,它运行得很好。(即-loclhost/myproject或127.0.0.1/myproject)。当我使用localhost/myproject并导航到其他页面(比如“联系我们”页面)时,它会重定向到127.0.0.1/myproject/contactus。这不是问题,因为它正确显示页面

当我尝试使用localhost在另一个ubuntu系统上运行相同的项目时,出现了一些问题。当我尝试127.0.0.1/myproject时,页面未加载。当我使用localhost:8080/myproject时,页面正在加载,但是css文件没有加载,因为它显示它是从127.0.0.1/assets/css加载的

即使我使用localhost:8080/myproject并导航到其他页面,它也会重定向到127.0.0.1/myproject/page

我正在ubuntu系统中运行一个使用codeigniter框架的PHP项目

当我尝试在windows Xampp上运行此程序时,它正在从localhost/myproject重定向到[::1]/myproject,如何避免这种重定向


如何仅从localhost加载页面?请帮助。

我认为codeigniter会根据您的配置进行一些重写

您的设置似乎有问题

  • config.php
  • 查看
    .htaccess
    ,查看是否提及域

localhost和127.0.0.1是同一件事。@i为什么它会显示不同的结果?谢谢兄弟。屏幕截图显示的“基本url”为空。我将我的根url(http:localhost/myproject)添加到base_url,解决了这个问题