我在服务器godaddy上使用codeigniter上传了我的网络项目,我可以通过此链接访问http://izhi-ks.org/facelajm/blog
我为这个网站购买了一个新域名www.facelajm.com,我已将目录更新为/ facelajm,我收到404 Page Not Found错误。
所以我的ftp看起来像这样:
在根目录中我有另一个joomla网站,在该目录中我有一个名为 facelajm 的文件夹。
在codeigniter根目录中,我有一个像这样的.htaccess:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
我做错了,我只能通过输入www.facelajm.com打开网站 事实上,如果我只创建一个新的index.php并打印hello world ... 我怀疑htaccess或者配置文件?
这里也是config.php:
$config['base_url'] = "";
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
答案 0 :(得分:6)
将.htaccess
目录(应该是您域的根目录)中的facelajm
更改为以下内容。我想您忘了打开RewriteEngine
忘记设置RewriteBase
:
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
<强>更新强>
需要在routes.php
$route['default_controller'] = 'blog';
答案 1 :(得分:2)
如果使用Codeigniter V3,请检查控制器的第一个字母是否为大写,例如:
ci/application/controllers/dealer/Api.php
答案 2 :(得分:0)
更新您的App
文件
config
答案 3 :(得分:0)
我迁移到新环境,并开始在所有子页面上显示404。我必须编辑Apache的httpd.conf,将 AllowOverride无的所有实例替换为 AllowOverride All (在我的情况下为231和268行)。重新加载Apache,它运行良好,无需任何进一步的更改。