<p>In example.com.nginx.ssl.conf need to insert:</p>

<pre><code>location / {
    try_files $uri/index.html $uri $uri/ /index.php?$query_string;
}
</code></pre>

CC BY-SA 4.0
2018-09-04T07:42:40.123Z
2018-09-04T07:42:40.123Z
Vitaliy  Badalov
<p>Change your site url in your config file.</p>

<p>Add a 301 redirect to your htaccess to send requests for http to https.</p>

<pre><code># Redirect http to https
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</code></pre>

<p>If that doesn't work for you then I suggest doing some Google searching. There are hundreds of guides on how to redirect http to https.</p>

<p>That's all you need to do.</p>

CC BY-SA 4.0
2018-09-03T10:37:37.627Z
I've added an example for you. But you could have done a quick Google search to find out how to do it. If you look over to the right on this page you'll probably see a few posts dealing with the same thing.
foamcow
CC BY-SA 4.0
2018-09-03T11:06:37.267Z
I did everything as in this article https://craftcms.com/support/force-ssl , but it did not help
Vitaliy  Badalov
CC BY-SA 4.0
2018-09-03T16:11:42.317Z
Can you give some more information? What happens? Do you get an error or does it simply not redirect? Perhaps update your question with the contents of your htaccess file to help someone debug/understand the issue. Are you using Craft 2 or Craft 3. What is your hosting environment?
foamcow
CC BY-SA 4.0
2018-09-03T18:47:43.457Z
I update answer
Vitaliy  Badalov
CC BY-SA 4.0
2018-09-03T10:08:32.190Z
2018-09-03T10:36:33.140Z
2018-09-03T10:36:33.140Z
foamcow
<p>I added support for https for the domain, But only the main page works How to make Сraft make the default site address with https instead of http?</p>

<p>Upd: Craft 3 on Vestacp and centos. Only the base url and static resources work, that is, only what is actually available. A craft path produces 404, for example, an example.com/admin</p>

<https>
transfer to HTTPS
# transfer to HTTPS

(Asked by: username_0 on 2018-09-03)

I added support for https for the domain, But only the main page works How to make Сraft make the default site address with https instead of http?

Upd: Craft 3 on Vestacp and centos. Only the base url and static resources work, that is, only what is actually available. A craft path produces 404, for example, an example.com/admin

**Tags:** https

---

## 2 answers

### Answer by username_0 on 2018-09-04. Score: 1 | Accepted answer

In example.com.nginx.ssl.conf need to insert:
location / {
    try_files $uri/index.html $uri $uri/ /index.php?$query_string;
}


---

### Answer by username_1 on 2018-09-03. Score: 2

Change your site url in your config file.
Add a 301 redirect to your htaccess to send requests for http to https.
# Redirect http to https
RewriteCond %{HTTP:X-Forwarded-Proto} !=https
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

If that doesn't work for you then I suggest doing some Google searching. There are hundreds of guides on how to redirect http to https.
That's all you need to do.

> **Comments:**
> **username_1**: I've added an example for you. But you could have done a quick Google search to find out how to do it. If you look over to the right on this page you'll probably see a few posts dealing with the same thing.  
> **username_0**: I did everything as in this article https://craftcms.com/support/force-ssl , but it did not help  
> **username_1**: Can you give some more information? What happens? Do you get an error or does it simply not redirect? Perhaps update your question with the contents of your htaccess file to help someone debug/understand the issue. Are you using Craft 2 or Craft 3. What is your hosting environment?  
> **username_0**: I update answer  

---

