【问题标题】:Codeigniter in localhost本地主机中的 Codeigniter
【发布时间】:2019-07-09 15:52:52
【问题描述】:

我还不明白 .htaccess。我有问题 codeigniter 应用程序在 localhost 中不起作用我的应用程序在此文件夹结构中

C:/xampp/htdocs/dev.application.pl/public_html/

我的 config.php 是

$config['base_url'] = 'http://localhost/dev.application.pl/';

在文件夹dev.application.php/ 我有这样的.htaccess

RewriteEngine On
RewriteBase /public_html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

但这不起作用。

【问题讨论】:

    标签: php .htaccess codeigniter


    【解决方案1】:

    编辑你的 .htaccess 到这个:

    RewriteEngine On
    RewriteBase /dev.application.pl/public_html
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
    
    

    希望对你有帮助:)

    【讨论】:

      【解决方案2】:

      编辑您的主机文件并添加 127.0.0.1 dev.application.pl

      $config['base_url'] = 'http://dev.application.pl/';

      htaccess:

      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php/$1 [L]
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2015-08-08
        • 2013-01-01
        • 2017-06-02
        • 1970-01-01
        • 1970-01-01
        • 2012-03-11
        • 1970-01-01
        相关资源
        最近更新 更多