Codeigniter项目在本地主机上不工作
我想运行codeigniter项目,我目前正在localhost中工作,我相应地设置了每个项目Codeigniter项目在本地主机上不工作,codeigniter,localhost,Codeigniter,Localhost,我想运行codeigniter项目,我目前正在localhost中工作,我相应地设置了每个项目 $config['base_url'] = 'http://localhost/site'; $config['index_page'] = ''; 它在我的办公室工作正常,但当我把它买回家在休息日多工作时,我开始出现错误,它只显示主页或索引页,当我导航到其他页面时,它显示404未找到的对象 只显示主页,其他所有路由均不工作 请帮助原因可以是 您可能已经在不同的CodeIgniter版本中复制了代
$config['base_url'] = 'http://localhost/site';
$config['index_page'] = '';
它在我的办公室工作正常,但当我把它买回家在休息日多工作时,我开始出现错误,它只显示主页或索引页,当我导航到其他页面时,它显示404未找到的对象
只显示主页,其他所有路由均不工作
请帮助原因可以是
创建.htaccess文件并输入以下代码:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
重新启动发动机
重写基/
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则^(.*)$index.php/$1[L]
答案似乎不完整,请添加更多详细信息这可能是因为缺少htaccess文件