<p>I have an SSL certificate installed on the server. Now I want to switch to https:// instead of http:// as the site is showing as "not secure".</p>

<p>I've updated the siteUrl and baseUrl in config/general.php:</p>

<pre><code>  ),
  'www.website.com.au' =&gt; array(
    'devMode' =&gt; false,
    'siteCached' =&gt; true,
    'omitScriptNameInUrls' =&gt; true,
    'allowAutoUpdates' =&gt; false,
    'siteUrl' =&gt; 'https://www.website.com.au/',
    'environmentVariables' =&gt; array(
      'baseUrl' =&gt; 'https://www.website.com.au/',
    ),
  ),
</code></pre>

<p>That didn't do anything.</p>

<p>Then, I tried updating these rules in the .htaccess:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
&lt;/IfModule&gt;
</code></pre>

<p>updated to:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]
&lt;/IfModule&gt;
</code></pre>

<p>and</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/home$
  RewriteRule ^(.*)$ http://www.website.com.au [R=301,NC,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/about-us$
  RewriteRule ^(.*)$ http://www.website.com.au/about-us/our-story [R=301,NC,L]

...
</code></pre>

<p>updated to:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/home$
  RewriteRule ^(.*)$ https://www.website.com.au [R=301,NC,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/about-us$
  RewriteRule ^(.*)$ https://www.website.com.au/about-us/our-story [R=301,NC,L]

...
</code></pre>

<p>These updates to .htaccess work for the home page, but when I visit any other page, the URL is https, but the page displays a 404 Not Found error.</p>

<p>How do I switch to https properly?</p>

<p>Thanks</p>

CC BY-SA 4.0
2019-07-12T08:25:50.397Z
I think obtain an SSL is a server issue not a problem can be solved by either "craft" or ".htaccess". You need to figure out what server software you are using. E.g. "Apache" or "Nigix" being the most popular for craft, after that research how to install SSL for it.
Parry Huang
CC BY-SA 4.0
2019-07-14T23:42:56.887Z
I have an SSL certificate installed
User543
CC BY-SA 4.0
2019-07-16T02:22:28.210Z
Since you are using htaccess, then you are using apache server. You need to find your httpd.conf file where writes the ```<VirtualHost *:80> ... </VirtualHost>``` And simply put code ```Redirect permanent / https://your-domain.com.au``` in it.
Parry Huang
<https><ssl>
404 on all pages but home after switch to https
# 404 on all pages but home after switch to https

(Asked by: username_0 on 2019-07-12)

I have an SSL certificate installed on the server. Now I want to switch to https:// instead of http:// as the site is showing as "not secure".
I've updated the siteUrl and baseUrl in config/general.php:
  ),
  'www.website.com.au' => array(
    'devMode' => false,
    'siteCached' => true,
    'omitScriptNameInUrls' => true,
    'allowAutoUpdates' => false,
    'siteUrl' => 'https://www.website.com.au/',
    'environmentVariables' => array(
      'baseUrl' => 'https://www.website.com.au/',
    ),
  ),

That didn't do anything.
Then, I tried updating these rules in the .htaccess:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]


updated to:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=302,L]


and

    RewriteEngine On

  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/home$
  RewriteRule ^(.*)$ http://www.website.com.au [R=301,NC,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/about-us$
  RewriteRule ^(.*)$ http://www.website.com.au/about-us/our-story [R=301,NC,L]

...

updated to:

    RewriteEngine On

  RewriteCond %{HTTP_HOST} !^www\.
  RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/home$
  RewriteRule ^(.*)$ https://www.website.com.au [R=301,NC,L]

  RewriteCond %{HTTP_HOST}%{REQUEST_URI} www.website.com.au/about-us$
  RewriteRule ^(.*)$ https://www.website.com.au/about-us/our-story [R=301,NC,L]

...

These updates to .htaccess work for the home page, but when I visit any other page, the URL is https, but the page displays a 404 Not Found error.
How do I switch to https properly?
Thanks

**Tags:** https, ssl
> **Comments:**
> **username_1**: I think obtain an SSL is a server issue not a problem can be solved by either "craft" or ".htaccess". You need to figure out what server software you are using. E.g. "Apache" or "Nigix" being the most popular for craft, after that research how to install SSL for it.  
> **username_0**: I have an SSL certificate installed  
> **username_1**: Since you are using htaccess, then you are using apache server. You need to find your httpd.conf file where writes the ```<VirtualHost *:80> ... </VirtualHost>``` And simply put code ```Redirect permanent / https://your-domain.com.au``` in it.  

---

## 0 answers

