【发布时间】:2013-08-14 16:09:04
【问题描述】:
我试图解决这个问题的 2 天。 我需要从 URL 中删除 index.php, 我的conf很好
$config['base_url'] = 'http://mywebsite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
(我更改了 uri_protocol 并尝试了所有建议的值)
.htaccess 文件就好了,
我尝试了很多关于 .htaccess 的建议,这是最后一个:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
这是文件的配置:
- bin
- etc
- mail
- public_ftp
- public_html
-- application
-- assets
-- system
-- .htaccess
-- index.php
如您所见,我的应用程序在public_html 文件上,我的服务器正在使用cpanel 加速器2 进行配置,我无法访问httpd.conf 以查看AllowOverride 是否设置为ALL .
我该如何解决这个问题?
【问题讨论】:
-
在 config.php 中,我使用:$config['uri_protocol'] = 'AUTO';
-
(仅供参考)我的 .htaccess 文件具有文件权限:705
-
我不认为它与我的 .htaccess 文件有关,我用所有可能的方式将其更改了很多次,但它仍然不起作用
标签: php codeigniter