在代码点火器中设置路径时出错


Having error in setting the path in codeigniter

我有一个web应用程序在服务器上成功运行。我从服务器上下载了完整的代码,并将其安装在带有xampp的本地机器上。

当我在本地服务器上运行它时,只有第一个登录页面正确显示,但当我使用用户名和密码登录时,页面上出现了如下错误。

Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
127.0.0.1
Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 

我的url是这样的127.0.0.1/myproject

一旦我使用用户名和密码登录,url就会转到这个127.0.0.1/myproject/user/login并显示错误。

我的默认控制器是user,它正在调用它的index function,但当我从控制器调用其他函数时,它总是显示相同的错误页面。

服务器上的基本url是这个http://192.168.10.170/cli/myfolder/project/myproject

我在本地机器上换的是这个http://127.0.0.1/myproject/

我不明白这里出了什么问题。如何在本地机器上运行此程序。

这是由.htaccess引起的。因此,在本地,您可以使用index.php?/更改基本url。

因此,您的示例登录页面url将是这样的。

127.0.0.1/myproject/index.php/用户/登录

请检查myproject文件夹中的.htaccess文件。

RewriteBase值需要根据本地计算机中的文件夹路径进行更改。