简体   繁体   English

带有codeigniter的每个页面均未找到“ 404页面未找到”

[英]'404 Page Not Found' every page with codeigniter

I used this .htaccess file on my localhost: 我在本地主机上使用了此.htaccess文件:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

But when I uploaded my site to the ftp, it suddenly doesn't work. 但是,当我将站点上传到ftp时,它突然不起作用。 I set the base_url. 我设置了base_url。 Mod rewrite is enabled. Mod重写已启用。 What else can be the problem. 还有什么可能是问题。 My knowledge is very limited, I was already happy, that I programming part, but this server stuff is over my head. 我对编程的知识非常有限,我已经很高兴,但是服务器的这些东西让我感到头疼。 But I'm willing to learn it, so if you recommend a place to start, I'm open to that. 但我愿意学习它,因此,如果您推荐一个起点,那么我很乐意。

So right now only a formatted page comes in, with basic css settings and the 404 message. 因此,目前只有带有基本CSS设置和404消息的格式化页面进入。 It's weird, that this message can be created in a form like that, so it means it's not a technical problem, but a settings problem. 可以以这种形式创建此消息很奇怪,所以这意味着这不是技术问题,而是设置问题。 I googled around, tried more .htaccess files, but nothing works. 我四处搜寻,尝试了更多.htaccess文件,但没有任何效果。 Thanks for your help! 谢谢你的帮助!

This is silly. 真傻 The controllers must be named starting with a big case letter. 控制器的名称必须以大写字母开头。 So the only problem was, that I named my default controller as welcome.php instead of Welcome.php. 因此,唯一的问题是,我将默认控制器命名为welcome.php而不是Welcome.php。 It was hard to figure out, because it worked on localhost. 很难弄清楚,因为它适用于localhost。 So this had nothing to do with .htaccess at all. 因此,这与.htaccess完全无关。 May be valuable to others, so they don't make the same mistake. 可能对其他人有价值,所以他们不会犯同样的错误。

I have seen this error when people are using FastCGI - you need to add to the config.php: 当人们使用FastCGI时,我已经看到此错误-您需要添加到config.php中:

$config['uri_protocol'] = "REQUEST_URI"; $ config ['uri_protocol'] =“ REQUEST_URI”;

This clicks everything together - Might not be the answer to this issue but worth a try and others with your symptoms may find this useful. 这将所有问题都联系在一起-可能不是解决此问题的方法,但是值得一试,其他有症状的人可能会发现这很有用。

Thanks, //P 谢谢,// P

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM