【问题标题】:Codeigniter website not working on localhostCodeigniter 网站无法在本地主机上运行
【发布时间】:2016-09-16 05:39:39
【问题描述】:

我从我的实时服务器下载了一个网站。我想在我的本地主机上运行它。我将base_url 更改为我的本地主机网址,但这不起作用。这是我的config.php

现场直播:

$config['base_url'] = 'http://my_site/portal/';

本地主机:

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

这是我的.HTACCESS

<IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteBase /portal/

        # Removes index.php from ExpressionEngine URLs
        RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
        RewriteCond %{REQUEST_URI} !/system/.* [NC]
        RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]

        # Directs all EE web requests through the site index file
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ /portal/index.php?/$1 [L]
</IfModule>

请帮助我,因为这是我在 codeigniter 中的第一个项目。

【问题讨论】:

    标签: php .htaccess codeigniter


    【解决方案1】:

    将您的RewriteBase 更改为/limo/portal/ 并从最后一个RewriteRule 中删除/portal/

    【讨论】:

    • 非常感谢先生。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-11-30
    • 2016-04-02
    • 2015-06-03
    • 2018-05-11
    相关资源
    最近更新 更多