2013-01-08 91 views
0

我正在使用Windows 7進行開發。Codeigniter Anchor不起作用

我在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] 
+0

也許它的大寫/小寫字母? – Kamil

+0

你可以向我們展示'contact'的控制器部分嗎? – Kamil

+0

我得到了這個工作。我的應用程序文件夾中有.htaccess文件,而不是域的根目錄。謝謝 – james

回答

0

我想通了。我的應用程序文件夾中有.htaccess文件,而不是網站的根目錄。