【发布时间】:2016-11-15 02:55:59
【问题描述】:
请有人帮我在我的网址中删除这个默认的“index.php”。我已经尝试了互联网上所有可能的解决方案(我猜......)关于如何删除这个。我开始解决这个问题已经 2 天了。
config.php
$host = gethostbyname($_SERVER['SERVER_NAME']);
$config['base_url'] = 'http://'.$host.':8080/rms/';
$config['index_page'] = ''; //-------------------->>>>>this should be blank, right?
$config['uri_protocol'] = 'REQUEST_URI';
我还在 codeigniter 文件夹中创建了一个.htaccess,其中有应用程序、图像等。
.htaccess
RewriteEngine On
RewriteBase /CodeIgniter/
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
然后我在 apache 模块中启用rewrite_module 并重新启动所有服务几次仍然无法正常工作。(哦,伙计!):-(
我确实将httpd.conf 中的AllowOverride None 更改为AllowOverride All
编辑:
我真的不明白似乎是什么问题,因为我网站的第一个界面的第一次加载很好,但是当要使用另一个控制器 controller/file.php 时,会弹出错误提示;
找不到
在此服务器上找不到请求的 URL /rms/eITRMS/btnLoginOnClick/myuser/mypass。
【问题讨论】:
-
尝试在 .htaccess 文件中使用
RewriteBase /rms/行。
标签: php apache .htaccess codeigniter