Codeigniter在localhost中的url上没有index.php但在服务器中没有工作

时间:2022-03-24 18:14:32

its bean 2 days that im trying to solve that problem. I need to remove the index.php from the URL, my conf is good

它的豆子2天,我试图解决这个问题。我需要从URL中删除index.php,我的conf很好

$config['base_url'] = 'http://mywebsite/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

(I changed the uri_protocol and tryied all the suggested values)

(我更改了uri_protocol并尝试了所有建议的值)

The .htaccess file is good to,

.htaccess文件很好用,

I tried to many suggestions on the .htaccess and here is the last one :

我尝试了很多关于.htaccess的建议,这是最后一个:

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

here is the disposition of the files :

这是文件的配置:

- bin
- etc
- mail
- public_ftp
- public_html
 -- application
 -- assets
 -- system
 -- .htaccess
 -- index.php

As you see, my application is on the public_html file, my server is using the cpanel accelerator 2 for the configuration, and i cant access the httpd.conf to see if the AllowOverride is setted to ALL.

如您所见,我的应用程序位于public_html文件中,我的服务器使用cpanel加速器2进行配置,我无法访问httpd.conf以查看AllowOverride是否设置为ALL。

How could i fix that problem ?

我怎么能解决这个问题?

1 个解决方案

#1


0  

I have same problem. Can you show your virtualhost file please edit:added my topic subject CodeIgniter index.php URL rewriting OVH

我有同样的问题。你能否展示你的虚拟主机文件请编辑:添加我的主题主题CodeIgniter index.php URL重写OVH

2nd edit: Try to remove the first / on your .htaccess like this RewriteRule ^(.*)$ index.php/$1 [L]

第2次编辑:尝试删除你的.htaccess上的第一个/像这个RewriteRule ^(。*)$ index.php / $ 1 [L]

#1


0  

I have same problem. Can you show your virtualhost file please edit:added my topic subject CodeIgniter index.php URL rewriting OVH

我有同样的问题。你能否展示你的虚拟主机文件请编辑:添加我的主题主题CodeIgniter index.php URL重写OVH

2nd edit: Try to remove the first / on your .htaccess like this RewriteRule ^(.*)$ index.php/$1 [L]

第2次编辑:尝试删除你的.htaccess上的第一个/像这个RewriteRule ^(。*)$ index.php / $ 1 [L]