0

我正在使用 Windows 7 进行开发。

我在 codeigniter 中的锚点有问题。我得到一个错误。

The requested URL /mysite/contact was not found on this server.

如果我将 index.php 添加到我的锚,它就可以工作。

<?php echo anchor('index.php/contact', 'Contact Us', 'title="Contact"');?>

如果我删除该index.php部分,那么我会收到上述错误。

我正在使用 WAMP 启用了重写模块。在我的配置中,我有以下内容。

$config['base_url'] = 'http://localhost/mysite';

$config['index_page'] = '';

最后这是我正在使用的 .haccess

RewriteEngine on
RewriteCond $1 !^(index\.php|images|captcha|css|js|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
4

1 回答 1

0

我想到了。我的应用程序文件夹中有 .htaccess 文件,而不是站点的根目录。

于 2013-01-10T01:43:49.843 回答