Php 编码点火器404错误

Php 编码点火器404错误,php,http-status-code-404,Php,Http Status Code 404,我创建了一个codeigniter网站。我的默认控制器是$route['default_controller']=“login”;在routes.php中 我的基本URL是$config['base_URL']='http://digimed.net/sandbox/'; 在config.php中 情景A 我在URL栏中输入我得到了登录控制器的索引方法 情景B 我输入了类似于404错误的内容,当时我期望得到与场景a相同的结果 事实上,我无法访问登录控制器中的任何函数。我每次都会遇到404错误 有

我创建了一个codeigniter网站。我的默认控制器是$route['default_controller']=“login”;在routes.php中

我的基本URL是$config['base_URL']='http://digimed.net/sandbox/'; 在config.php中

情景A 我在URL栏中输入我得到了登录控制器的索引方法

情景B 我输入了类似于404错误的内容,当时我期望得到与场景a相同的结果

事实上,我无法访问登录控制器中的任何函数。我每次都会遇到404错误

有什么我需要改变的路线或康吉


谢谢

如果有人感兴趣,我通过在网站路由目录(codeigniter路由目录所在的位置)中添加以下.htaccess文件解决了问题


重新启动发动机
重写库/系统管理员
#删除用户对系统文件夹的访问权限。
#此外,这将允许您创建System.php控制器,
#以前这是不可能的。
#如果已重命名系统文件夹,则可以替换“系统”。
重写COND%{REQUEST_URI}^系统*
重写规则^(.*)$/index.php/$1[L]
#检查用户是否试图访问有效文件,
#例如图像或css文档,如果这不是真的,它会发送
#请求index.php
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
#最后一个条件允许访问图像和css文件夹以及robots.txt文件
#Michael Radlmaier(mradlmaier)提交
1美元^(索引\.php | images | robots\.txt | css)
重写规则^(.*)$index.php/$1[L]
#如果我们没有安装mod_rewrite,所有404
#可以发送到index.php,一切正常。
#提交人:ElliotHaughin
ErrorDocument 404/index.php

您为Web服务器设置了重写规则了吗?嗯,不是特别没有。我该怎么做?尝试将您的浏览器指向,如果它工作正常,则表示您错过了重写规则,请参阅Kevin'sanswer@Kevin什么是系统_管理给重写库?我的网站的URL类似于subdomain.example.com,文件放在我的根文件夹中。如果是这样的话,应该重写什么?@NaveedS我不确定你会如何将RewriteBase用于子域,但在我的例子中,我用它将我的安装标记为example.com/system\u admin。我的文件位于example.com目录中名为system_admin的文件夹中
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /system_admin

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

ErrorDocument 404 /index.php
</IfModule>