gpt4 book ai didi

php - ssl 未在 codeigniter 网站的首次访问中显示

转载 作者:行者123 更新时间:2023-12-04 22:39:11 25 4
gpt4 key购买 nike

我在我的 codeigniter 网站中安装了 ssl,该网站是实时的,并且我启用了强制 https 选项,我的主机是托管商,SSL 颁发者:Let's Encrypt Authority X3。
这里的问题是,当用户第一次访问该网站时,它在没有 SSL 的情况下显示“不安全”,然后如果您转到另一个页面显示 SSL,然后如果您再次访问主页,则 SSL 存在,问题出在第一次访问使用浏览器的搜索栏,每当你使用浏览器的搜索栏时,都会发生这种情况,任何设备和浏览器都是这样。
下面的实时 URL 是我的 config.php:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
$config['url_suffix'] = '';
$config['language'] = 'english';
$config['charset'] = 'UTF-8';
$config['enable_hooks'] = FALSE;
$config['subclass_prefix'] = 'MY_';
$config['composer_autoload'] = FALSE;
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
$config['directory_trigger'] = 'd';
$config['allow_get_array'] = TRUE;
$config['log_threshold'] = 0;
$config['log_path'] = '';
$config['log_file_extension'] = '';
$config['log_file_permissions'] = 0644;
$config['log_date_format'] = 'Y-m-d H:i:s';
$config['error_views_path'] = '';
$config['cache_path'] = '';
$config['cache_query_string'] = FALSE;
$config['encryption_key'] = '';
$config['sess_driver'] = 'files';
$config['sess_cookie_name'] = 'ci_session';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = NULL;
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE;
$config['cookie_prefix'] = '';
$config['cookie_domain'] = '';
$config['cookie_path'] = '/';
$config['cookie_secure'] = FALSE;
$config['cookie_httponly'] = FALSE;
$config['standardize_newlines'] = FALSE;
$config['global_xss_filtering'] = FALSE;
$config['csrf_protection'] = FALSE;
$config['csrf_token_name'] = 'csrf_test_name';
$config['csrf_cookie_name'] = 'csrf_cookie_name';
$config['csrf_expire'] = 7200;
$config['csrf_regenerate'] = TRUE;
$config['csrf_exclude_uris'] = array();
$config['compress_output'] = FALSE;
$config['time_reference'] = 'local';
$config['rewrite_short_tags'] = FALSE;
$config['proxy_ips'] = '';
这是我的 htaccess 代码:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
谁能告诉我这里可能出了什么问题,在此先感谢

最佳答案

在 .htaccess 中设置重定向

RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

关于php - ssl 未在 codeigniter 网站的首次访问中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65323383/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com