.htaccess HTTPS URL中的Codeigniter Index.php

.htaccess HTTPS URL中的Codeigniter Index.php,.htaccess,codeigniter,ssl,https,indexing,.htaccess,Codeigniter,Ssl,Https,Indexing,我对CodeIgniter和htaccess有问题 当我通过http或localhost访问我的网站时,我可以访问mysite.ext/controller/view,比如admin/login 但是,当我以前使用HTTPS访问我的网站时,它发送了一个404错误,因此我必须编写mysite.ext/index.php/controller/view,它可以工作 问题是我不想要index.php,当我尝试在internet上找到的解决方案时,它有时会删除index.php,但我只能访问/index

我对CodeIgniter和htaccess有问题

当我通过http或localhost访问我的网站时,我可以访问mysite.ext/controller/view,比如admin/login

但是,当我以前使用HTTPS访问我的网站时,它发送了一个404错误,因此我必须编写mysite.ext/index.php/controller/view,它可以工作

问题是我不想要index.php,当我尝试在internet上找到的解决方案时,它有时会删除index.php,但我只能访问/index/控制器,而不能访问管理员和其他控制器

我在这里尝试了这个解决方案:

它删除了index.php,这是引导,并且控制器/视图索引/首页工作,但其他控制器不工作

注意:HTTPS URL与HTTP URL不同。HTTP URL连接到服务器,但HTTPS由我的主机提供(因此,HTTPS://ovh….blablabla../mywebsite/)


我想了解它为什么不工作,并找到如何纠正它。

https url中的codeIgniter设置没有专门的配置。首先,从配置文件中删除$config['base_url],并在$config['index']属性中放入“”(空白)

您可以将.htaccess文件设置为

<IfModule mod_rewrite.c>
 RewriteEngine On

  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d

  # Rewrite all other URLs to index.php/URL
  RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
  </IfModule>
  <IfModule !mod_rewrite.c>
      ErrorDocument 404 index.php
  </IfModule>

重新启动发动机
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
#将所有其他URL重写为index.php/URL
重写规则^(.*)$index.php?url=$1[PT,L]
ErrorDocument 404 index.php
上面的代码是从url中删除index.php