2013-01-18 47 views
0

我尝试在本地主机上使用Codeigniter和WAMP。 问题是,我可以在基本控制器中打开基本功能,并且当我尝试使用根网站/控制器/功能时,它不起作用。结果是它让我回到了wamp开始页面,或者找不到页面的文本。Codeigniter in localhost WAMP Windows

大多数情况下,我找到了关于制作.htaccess文件的解决方案,以及许多变化。 在wamp.conf文件中取消对rewrtie mod的注释。并在我的网页上留下index_page为空。

但它不适合我。

我的控制器:

class Home extends CI_Controller { 

    function index() { 

      $this->load->view('index'); 
      } 

    function slide() { 

      $this->load->view('slider'); 
      } 
} 

而且我的网页是:WWW/mysite的/ ....

回答

0

试试这个.htaccess

RewriteEngine on 

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

RewriteCond $1 !^(index\.php|indexcp\.php?|resources|robots\.txt) 
RewriteRule ^([A-Za-z0-9_/.-]+)$ index.php?$1 

RewriteRule ^(CSI) index.php?/CSI 
AddType text/x-component .htc 

编辑

在这里添加上面的代码

enter image description here

不要改变任何东西CI system ..

一旦选中此repo

+0

啊它不工作过。我有它在www /站点/文件夹。 –

+0

@ daniela.svas:设置$ config ['uri_protocol'] \t ='REQUEST_URI';'在配置 – mrsrinivas

+0

请确保它位于与index.php相同的文件夹中 – Jeemusu