找不到对象!重定向链接codeigniter

时间:2013-11-05 10:23:11

标签: php codeigniter redirect

为什么我收到错误: 我的代码:

<li><a href="<?php echo base_url(); ?>welcome/logout">Log Out</a></li>

错误:

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.

Error 404

localhost
11/05/13 17:20:15
Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1

2 个答案:

答案 0 :(得分:0)

以下是机会

  1. 您可以将此为空$ config ['base_url'] ='';
  2. 使用index.php文件检查根文件夹中的.htaccess
  3. 检查mod_rewrite apache模块是否已启用
  4. RewriteEngine On RewriteBase / RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule ^(。*)$ index.php / $ 1 [L]

答案 1 :(得分:0)

你在控制器上使用过这条指令吗?

$this->load->helper('url');