我正在使用 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]