【发布时间】:2018-07-20 22:15:35
【问题描述】:
我在代码点火器上开发了一个 Web 应用程序。这是我第一次使用 code-igniter 在我的本地主机上开发 Web 应用程序后,它工作正常。但是当我在服务器中托管该站点时,主索引页面正在打开,但子页面显示"404 page not found error"。你能指导我吗?这是我的 htacess 文件
RewriteBase /
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/system.*
RewriteRule ^(.*) index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+) index.php?/$1 [L]`
在我的routes.php 中,我添加了以下行
$route['about'] = 'mycontroller/about';
【问题讨论】:
-
你在
config.php$config['index_page'] = '';有什么?它应该在第 34 行附近。 -
看看这个stackoverflow.com/questions/28801605/… 你会看到一些 htaccess 试试看。
-
我替换了 $config['index_page'] = 'index.php'; $config['index_page'] = ' ';在 config.php 中
-
然后发生了什么。您可能还需要检查路由是否与控制器和重定向等匹配。
-
是的,我查过了!我提到了这个链接stackoverflow.com/questions/7615284/…,但我没有找到任何解决方案。他们提供的链接没有打开
标签: codeigniter