【问题标题】:Codeigniter in localhost WAMP Windows本地主机 WAMP Windows 中的 Codeigniter
【发布时间】:2013-01-01 22:52:24
【问题描述】:

我尝试在带有 WAMP 的 localhost 中使用 Codeigniter。 问题是,我只能在基本控制器中打开基本功能,当我尝试使用像站点/控制器/功能这样的 root 时,它不起作用。结果是它让我回到了 wamp 起始页面,或者找不到该页面的文本。

主要是我找到了有关制作 .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/....

【问题讨论】:

    标签: windows codeigniter localhost wamp


    【解决方案1】:

    试试这个.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
    

    编辑

    在此处添加上述代码

    不要更改CI system..中的任何内容。

    检查一下repo

    【讨论】:

    • @daniela.svas:在配置中设置$config['uri_protocol'] = 'REQUEST_URI';
    • 确保它和你的 index.php 在同一个文件夹中
    • 我改了。与索引相同的文件夹,还是所有 codeigniter 东西的基本文件夹?还是在应用程序/查看文件中?
    猜你喜欢
    • 2018-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-14
    • 2016-11-16
    • 2012-03-21
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多