<p>For others with the same issue, I managed to get this resolved by adding baseCpUrl in the general.php file</p>
<pre><code>'baseCpUrl' =&gt; 'https://www.domain.co.in'
</code></pre>
<p>For more details visit <a href="https://craftcms.com/docs/3.x/config/config-settings.html#basecpurl" rel="nofollow noreferrer">https://craftcms.com/docs/3.x/config/config-settings.html#basecpurl</a></p>

CC BY-SA 4.0
2022-02-03T03:51:03.687Z
2022-02-03T03:51:03.687Z
harshal jadhav
<p>I have 2 websites one in craft cms 2 and the other in craft cms 3.</p>
<p>Everything works fine except the control panel always shows HTTPS insecure, for both the sites.</p>
<p>Below is my .htacces file,</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
  RewriteEngine On

  RewriteCond %{HTTP_HOST} ^domain.co.in
  RewriteRule (.*) https://www.domain.co.in/$1 [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=$1 [QSA,L]
&lt;/IfModule&gt;
&lt;IfModule mod_headers.c&gt;
    Header set Access-Control-Allow-Origin http://www.domain.co.in
    Header set Access-Control-Allow-Credentials true
&lt;/IfModule&gt;
</code></pre>
<p>General.php</p>
<pre><code>define('URI_SCHEME',  ( isset($_SERVER['HTTPS'] ) ) ? &quot;https://&quot; : &quot;http://&quot; );
    define('SITE_URL',    URI_SCHEME . $_SERVER['SERVER_NAME'] . '/');
    define('BASEPATH',    realpath(CRAFT_BASE_PATH . '/../') . '/');
    return array(
        '*' =&gt; array(
            'environmentVariables' =&gt; array(
                'siteUrl'  =&gt; SITE_URL,
                'basePath' =&gt; BASEPATH
            ),
            'cpTrigger' =&gt; 'manage',
            'omitScriptNameInUrls' =&gt; TRUE, 
            'defaultTokenDuration' =&gt; 'P1W',  
            'sendPoweredByHeader' =&gt; FALSE, 
            'enableCsrfProtection' =&gt; TRUE, 
            'pageTrigger' =&gt; 'page/', 
        ),
        'prod' =&gt; array(
            'allowAutoUpdates' =&gt; FALSE, 
            'env' =&gt; 'prod',
            'siteUrl' =&gt; 'https://'.$_SERVER['HTTP_HOST']
        ),
        'stage' =&gt; array(    
            'devMode' =&gt; FALSE,
            'env' =&gt; 'stage',
            'siteUrl' =&gt; 'https://'.$_SERVER['HTTP_HOST']
        ),
        'local' =&gt; array(
            'siteUrl' =&gt; 'http://'.$_SERVER['HTTP_HOST'],
            'devMode' =&gt; TRUE,
            'env' =&gt; 'local'
        )
    );
</code></pre>

<craft3><craft2><htaccess><ssl>
Craft CMS SSL added to website correctly but says insecure for admin panel
# Craft CMS SSL added to website correctly but says insecure for admin panel

(Asked by: username_0 on 2022-01-19)

I have 2 websites one in craft cms 2 and the other in craft cms 3.
Everything works fine except the control panel always shows HTTPS insecure, for both the sites.
Below is my .htacces file,

  RewriteEngine On

  RewriteCond %{HTTP_HOST} ^domain.co.in
  RewriteRule (.*) https://www.domain.co.in/$1 [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=$1 [QSA,L]


    Header set Access-Control-Allow-Origin http://www.domain.co.in
    Header set Access-Control-Allow-Credentials true


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'
        )
    );

**Tags:** craft3, craft2, htaccess, ssl

---

## 1 answers

### Answer by username_0 on 2022-02-03. Score: 1 | Accepted answer

For others with the same issue, I managed to get this resolved by adding baseCpUrl in the general.php file
'baseCpUrl' => 'https://www.domain.co.in'

For more details visit https://craftcms.com/docs/3.x/config/config-settings.html#basecpurl


---

