.htaccess文件无法在godaddy服务器上运行

时间:2016-12-08 11:52:32

标签: php .htaccess codeigniter

有人可以告诉我为什么这段代码可以在我的本地服务器上运行,但不能在godaddy服务器上运行?

我在godaddy上得到以下错误......

我在godaddy服务器上创建了一个codeigniter项目和主机,但.htaccess文件无法正常工作

我的问题是" https://www.tripbrip.com/index.php/home/app_view"这个相同的网址来自我的网址,但我想删除此链接中的index.php

我的目录结构是:

Options +MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ index.php/?$1 [NC,L]

my config file:
$config['base_url'] = "https://".$_SERVER['HTTP_HOST'].'/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

此文件在我的localhost中运行,但不在服务器上运行。

我使用了很多代码,但问题仍然存在。

如果我浏览http://example.com/bootstrap.php,我会在/

获得404资源

1 个答案:

答案 0 :(得分:0)

也许你可以试试把它放在你的.htaccess

$config['base_url'] = '';

并为您的配置文件。也许你可以把它清空。

$config['base_url'] = "http://".$_SERVER['HTTP_HOST']; $config['base_url'] .= preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])).'/';

如果仍然出错,可以试试这个

import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


public class LegController {
    private List<Runnable> legs;
    private ExecutorService execute;

    public LegController() {
        legs = new ArrayList<>();
        for (int i = 0; i < 6; i++) {
            legs.add(LegFactory.getLeg("LEFT"));
        }

        execute = new Executors.newFixedThreadPool(6);
    }

    public void start(){

        //TODO
    }
}
相关问题