天天看点

https 去除index.php,index.php没有删除https CodeIgniter

似乎您的主机文件中存在问题.

如果您使用的是apache,请更改您的主机文件;

ServerAdmin [email protected]

DocumentRoot /path

ServerName xyz.mydomain.com

ServerAlias www.xyz.mydomain.com

SSLEngine On

SSLOptions +StrictRequire

SSLCertificateFile /path to ssl file/mydomain.crt

SSLCertificateKeyFile /path to ssl file/mydomain.key

SSLProtocol TLSv1

Require all granted

Options -FollowSymLinks -Includes -ExecCGI -Indexes

AllowOverride All

Order allow,deny

Allow from all

RewriteEngine On

现在为您的htaccess文件添加如下内容:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$https://xyz.mydomain.com/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$index.PHP/$1 [L]

快乐编码:)