【发布时间】:2016-12-12 04:00:55
【问题描述】:
谁能告诉我为什么这段代码可以在我的本地服务器上运行,但不能在 Godaddy 服务器上运行?
我在 Godaddy 上收到以下错误...
我创建了一个 codeigniter 项目并在 godaddy 服务器上托管,但 .htaccess 文件不起作用
我的问题是“https://www.tripbrip.com/index.php/home/app_view”这个相同的 url 出现在我的 url 端,但我想删除这个链接中的 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';
此文件在我的本地主机中运行,但在服务器上不起作用。
我使用了很多代码,但问题仍然存在。
如果我浏览到 http://example.com/bootstrap.php,我会得到一个 404 资源在 / 处不可用
【问题讨论】:
-
尝试查看此处发布的解决方案:stackoverflow.com/questions/19183311/…
标签: php .htaccess codeigniter