SSL 已正确添加到网站,但显示管理面板不安全
SSL added to website correctly but says insecure for admin panel
我有 2 个网站,一个在 craft cms 2 中,另一个在 craft cms 3 中。
除了两个站点的控制面板始终显示 HTTPS 不安全外,一切正常。
下面是我的 .htacces 文件,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.co.in
RewriteRule (.*) https://www.domain.co.in/ [R=301,L]
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p= [QSA,L]
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin http://www.domain.co.in
Header set Access-Control-Allow-Credentials true
</IfModule>
General.php
define('URI_SCHEME', ( isset($_SERVER['HTTPS'] ) ) ? "https://" : "http://" );
define('SITE_URL', URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');
define('BASEPATH', realpath(CRAFT_BASE_PATH . '/../') . '/');
return array(
'*' => array(
'environmentVariables' => array(
'siteUrl' => SITE_URL,
'basePath' => BASEPATH
),
'cpTrigger' => 'manage',
'omitScriptNameInUrls' => TRUE,
'defaultTokenDuration' => 'P1W',
'sendPoweredByHeader' => FALSE,
'enableCsrfProtection' => TRUE,
'pageTrigger' => 'page/',
),
'prod' => array(
'allowAutoUpdates' => FALSE,
'env' => 'prod',
'siteUrl' => 'https://'.$_SERVER['HTTP_HOST']
),
'stage' => array(
'devMode' => FALSE,
'env' => 'stage',
'siteUrl' => 'https://'.$_SERVER['HTTP_HOST']
),
'local' => array(
'siteUrl' => 'http://'.$_SERVER['HTTP_HOST'],
'devMode' => TRUE,
'env' => 'local'
)
);
对于其他有同样问题的人,我设法通过在 general.php 文件中添加 baseCpUrl 来解决这个问题
'baseCpUrl' => 'https://www.domain.co.in'
有关详细信息,请访问 https://craftcms.com/docs/3.x/config/config-settings.html#basecpurl
我有 2 个网站,一个在 craft cms 2 中,另一个在 craft cms 3 中。
除了两个站点的控制面板始终显示 HTTPS 不安全外,一切正常。
下面是我的 .htacces 文件,
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.co.in
RewriteRule (.*) https://www.domain.co.in/ [R=301,L]
# Send would-be 404 requests to Craft
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
RewriteRule (.+) index.php?p= [QSA,L]
</IfModule>
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin http://www.domain.co.in
Header set Access-Control-Allow-Credentials true
</IfModule>
General.php
define('URI_SCHEME', ( isset($_SERVER['HTTPS'] ) ) ? "https://" : "http://" );
define('SITE_URL', URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');
define('BASEPATH', realpath(CRAFT_BASE_PATH . '/../') . '/');
return array(
'*' => array(
'environmentVariables' => array(
'siteUrl' => SITE_URL,
'basePath' => BASEPATH
),
'cpTrigger' => 'manage',
'omitScriptNameInUrls' => TRUE,
'defaultTokenDuration' => 'P1W',
'sendPoweredByHeader' => FALSE,
'enableCsrfProtection' => TRUE,
'pageTrigger' => 'page/',
),
'prod' => array(
'allowAutoUpdates' => FALSE,
'env' => 'prod',
'siteUrl' => 'https://'.$_SERVER['HTTP_HOST']
),
'stage' => array(
'devMode' => FALSE,
'env' => 'stage',
'siteUrl' => 'https://'.$_SERVER['HTTP_HOST']
),
'local' => array(
'siteUrl' => 'http://'.$_SERVER['HTTP_HOST'],
'devMode' => TRUE,
'env' => 'local'
)
);
对于其他有同样问题的人,我设法通过在 general.php 文件中添加 baseCpUrl 来解决这个问题
'baseCpUrl' => 'https://www.domain.co.in'
有关详细信息,请访问 https://craftcms.com/docs/3.x/config/config-settings.html#basecpurl