【问题标题】:Codeigniter works fine without index.php on the url in localhost but not in serverCodeigniter 在 localhost 的 url 上没有 index.php 的情况下工作正常,但在服务器中却没有
【发布时间】: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 .

我该如何解决这个问题?

【问题讨论】:

标签: php codeigniter


【解决方案1】:

我也有同样的问题。你能显示你的虚拟主机文件吗 编辑:添加了我的主题CodeIgniter index.php URL rewriting OVH

第二次编辑: 尝试像这样 RewriteRule ^(.*)$ index.php/$1 [L]

删除 .htaccess 上的第一个 /

【讨论】:

  • 在哪里可以找到我的虚拟主机文件?我删除了 / 但它仍然不起作用
  • 如何使用 ssh 访问文件?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-01-20
  • 2014-11-21
  • 2021-06-01
  • 2020-04-04
  • 2013-12-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多