天天看點

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]

快樂編碼:)