php Codeigniter“未找到请求的 URL”错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21722778/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Codeigniter “The requested URL was not found” error
提问by user2951386
I downloaded project the my server then I changed config file and database as usually and finally i deleted the htaccess file that is in the main folder. Now i can go to my home page but i can't go to other links in my site and i got this error.
我下载了我的服务器的项目,然后我像往常一样更改了配置文件和数据库,最后我删除了主文件夹中的 htaccess 文件。现在我可以转到我的主页,但我无法转到我网站中的其他链接,并且出现此错误。
**Not Found
The requested URL /utripes/auther/signup signup was not found on this server.**
How can i fix this error. please need quick help. than you.
我该如何解决这个错误。请需要快速帮助。比你。
回答by Hasib Hasan Arnab
As you delete the htaccess file from your project root directory so your url should include index.php.
当您从项目根目录中删除 htaccess 文件时,您的 url 应包含 index.php。
I recommend that you include the htaccess file in your project root directory and paste the following code into the htaccess file..
我建议您将 htaccess 文件包含在您的项目根目录中,并将以下代码粘贴到 htaccess 文件中。
RewriteEngine on
RewriteCond !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?
I think now your project should work fine..
我认为现在您的项目应该可以正常工作..
回答by Oussama
your rewrite rule should be like this
你的重写规则应该是这样的
RewriteRule ^(.*)$ /new/index.php?/ [L,QSA]
回答by nitol arafat
<IfModule mod_rewrite.c>
RewriteEngine On
#RewriteBase /your_project/
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/ [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/ [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
回答by Edphp
I encountered the same issue, but I moved my site from another server to current and in the process, uploaded all files to google drive and downloaded to current server, that changed names of all .* files to _*
我遇到了同样的问题,但我将我的网站从另一台服务器移到了当前,在此过程中,将所有文件上传到谷歌驱动器并下载到当前服务器,将所有 .* 文件的名称更改为 _*
I changed all names back to .* and was able to connect to subsequent pages of my codeigniter website.
我将所有名称改回 .* 并且能够连接到我的 codeigniter 网站的后续页面。

