为什么离线下载我的网络文件后我需要添加index.php?

时间:2016-12-17 13:53:45

标签: codeigniter

我想知道我的离线和在线页面有什么区别?

离线下载我的页面后,我需要在我的文件夹文件后添加(index.php)以使其可见?

http://localhost/gsaconst/index.php/articles/news

我的在线页面将是

http://www.gsa-constructionspecialist.com/articles/news

如何删除离线页面中的index.php并仍然可以查看,而不是像以下错误消息:

找不到对象!

在此服务器上找不到请求的URL。引用页面上的链接似乎是错误的或过时的。请通知该页面的作者有关错误的信息。

1 个答案:

答案 0 :(得分:0)

您需要在离线目录中添加.htaccess文件

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

并确保从配置文件中删除index.php
$config['index_page'] = 'index.php'; 找到配置文件 application / config / config.php