<p>Sprig will use whatever your site's base URL is set to, to construct the action URL. Ensure in <code>Settings → Sites</code> that the base URL is either set to an absolute path starting with <code>https://</code>, or if an alias or environment variable, that it is defined as an absolute path starting with <code>https://</code>.</p>
<p>Also be sure to either force the <code>www</code> subdomain or force a naked domain. in your example above I see one with and one without <code>www</code>.</p>

CC BY-SA 4.0
2021-03-27T12:48:10.160Z
Just double checked, the base URL is already set to use https://. Is there some kind of sprig cache or database that is remembering old non-ssl paths that i need to clear? I already tried clearing the caches in craft, and uninstalling/re-installing sprig
Justin Kendall
CC BY-SA 4.0
2021-03-27T16:27:20.813Z
Updated my answer to include forcing the `www` subdomain or a naked domain.
Ben Croker
CC BY-SA 4.0
2021-03-27T17:06:15.710Z
I am forcing it to remove www in my .htaccess file (I updated my question to include that info). Is there a better way of doing that?
Justin Kendall
CC BY-SA 4.0
2021-03-27T17:10:41.070Z
So I just realized in looking at the forcing www to be removed that it is http not https. I just added the "s" and that got rid of the "Blocked loading mixed active content" error, but I still have the cross origin error.
Justin Kendall
CC BY-SA 4.0
2021-03-27T17:16:34.230Z
Updated question with current errors
Justin Kendall
CC BY-SA 4.0
2021-03-28T02:40:46.387Z
After further investigation, even though I was forcing the removal of `www` though .htaccess, my base URL still had `www` in it. Removing that resolved the issue!
Justin Kendall
CC BY-SA 4.0
2021-03-27T08:10:15.627Z
2021-03-27T16:26:47.493Z
2021-03-27T16:26:47.493Z
Ben Croker
<p>I've recently added an SSL to the site I'm working on, and it seems to have broken my &quot;load more&quot; buttons via <a href="https://putyourlightson.com/sprig/cookbook#load-more" rel="nofollow noreferrer">sprig</a>. When I click the button now, I get</p>
<blockquote>
<p>Blocked loading mixed active content “http://mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6”</p>
</blockquote>
<p>and</p>
<blockquote>
<p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6" rel="nofollow noreferrer">https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6</a>. (Reason: CORS request did not succeed).</p>
</blockquote>
<p>errors in my console. I've noticed that the cross origin error is trying to load stuff over <strong>https</strong> but the mixed active content error is trying to load over <strong>http</strong>.</p>
<p>How can I get this working again over <strong>https</strong>?</p>
<p>Here's my sprig code if you need it:</p>
<pre><code>{{ sprig('_layouts/_blog/_loadMore', {'limit': 6}) }}
{{ sprig.script }}
</code></pre>
<pre><code>{% set offset = offset ?? 0 %}

{% set entryQuery = craft.entries.section('diggingDeeper').offset(offset).limit(limit) %}
{% set entries = entryQuery.all() %}

{% for entry in entries %}

    ----Entry Stuff----

{% endfor %}

            
{% if entryQuery.count() &gt; offset + entries|length %}
  &lt;button class=&quot;orange-button&quot; sprig s-val:offset=&quot;{{ offset + limit }}&quot; 
    s-target=&quot;this&quot; s-swap=&quot;outerHTML&quot;&gt;
    &lt;p&gt;Load More&lt;/p&gt;
  &lt;/button&gt;
{% endif %}
</code></pre>
<p><strong>Edit:</strong>
Added the full errors</p>
<p><strong>Edit 2:</strong>
Here is my .htaccess file that forces https and removes www</p>
<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

# 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]

# Force https
RewriteCond %{HTTP_HOST} mydomainname\.net [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mydomainname.net/$1 [R,L]

# Remove the www from the URL
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    
&lt;/IfModule&gt;
</code></pre>
<p><strong>Edit 3:</strong>
After resolving the &quot;Blocked loading mixed active content&quot; error these are the current errors in the console when the load more button is clicked</p>
<blockquote>
<p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6" rel="nofollow noreferrer">https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6</a>. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).</p>
</blockquote>
<blockquote>
<p>htmx:afterRequest htmx-1.2.1.js:1368:25</p>
</blockquote>
<blockquote>
<p>Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at <a href="https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6" rel="nofollow noreferrer">https://www.mydomainname.net/index.php?p=actions/sprig/components/render&amp;offset=6&amp;sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&amp;sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&amp;sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6</a>. (Reason: CORS request did not succeed).</p>
</blockquote>
<blockquote>
<p>htmx:sendError htmx-1.2.1.js:1368:25</p>
</blockquote>

<craft3><https><plugin-sprig>
Sprig "Load more" not loading over https
# Sprig "Load more" not loading over https

(Asked by: username_0 on 2021-03-26)

I've recently added an SSL to the site I'm working on, and it seems to have broken my "load more" buttons via sprig. When I click the button now, I get

Blocked loading mixed active content “http://mydomainname.net/index.php?p=actions/sprig/components/render&offset=6&sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6”

and

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.mydomainname.net/index.php?p=actions/sprig/components/render&offset=6&sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6. (Reason: CORS request did not succeed).

errors in my console. I've noticed that the cross origin error is trying to load stuff over https but the mixed active content error is trying to load over http.
How can I get this working again over https?
Here's my sprig code if you need it:
{{ sprig('_layouts/_blog/_loadMore', {'limit': 6}) }}
{{ sprig.script }}

{% set offset = offset ?? 0 %}

{% set entryQuery = craft.entries.section('diggingDeeper').offset(offset).limit(limit) %}
{% set entries = entryQuery.all() %}

{% for entry in entries %}

    ----Entry Stuff----

{% endfor %}

            
{% if entryQuery.count() > offset + entries|length %}
  
    Load More
  
{% endif %}

Edit:
Added the full errors
Edit 2:
Here is my .htaccess file that forces https and removes www

    RewriteEngine On

# 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]

# Force https
RewriteCond %{HTTP_HOST} mydomainname\.net [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://mydomainname.net/$1 [R,L]

# Remove the www from the URL
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
    


Edit 3:
After resolving the "Blocked loading mixed active content" error these are the current errors in the console when the load more button is clicked

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.mydomainname.net/index.php?p=actions/sprig/components/render&offset=6&sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).


htmx:afterRequest htmx-1.2.1.js:1368:25


Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.mydomainname.net/index.php?p=actions/sprig/components/render&offset=6&sprig%3AsiteId=32200a47f3a91660d5c53896017cd9e51baccf7f69c571407279fa99ecbcffb91&sprig%3Atemplate=0fb8ec651fc53258017209d22d4e19b6143ac209993784d01a06801fd13e9cd6_layouts%2F_blog%2F_loadMore&sprig%3Avariables%5Blimit%5D=15a1fe68dab9e8d01fdd3bc84980fa5d354e5c72f0e00d06e0841462638f363d6. (Reason: CORS request did not succeed).


htmx:sendError htmx-1.2.1.js:1368:25

**Tags:** craft3, https, plugin-sprig

---

## 1 answers

### Answer by username_1 on 2021-03-27. Score: 2 | Accepted answer

Sprig will use whatever your site's base URL is set to, to construct the action URL. Ensure in `Settings → Sites` that the base URL is either set to an absolute path starting with `https://`, or if an alias or environment variable, that it is defined as an absolute path starting with `https://`.

Also be sure to either force the `www` subdomain or force a naked domain. in your example above I see one with and one without `www`.

> **Comments:**
> **username_0**: Just double checked, the base URL is already set to use https://. Is there some kind of sprig cache or database that is remembering old non-ssl paths that i need to clear? I already tried clearing the caches in craft, and uninstalling/re-installing sprig  
> **username_1**: Updated my answer to include forcing the `www` subdomain or a naked domain.  
> **username_0**: I am forcing it to remove www in my .htaccess file (I updated my question to include that info). Is there a better way of doing that?  
> **username_0**: So I just realized in looking at the forcing www to be removed that it is http not https. I just added the "s" and that got rid of the "Blocked loading mixed active content" error, but I still have the cross origin error.  
> **username_0**: Updated question with current errors  
> **username_0**: After further investigation, even though I was forcing the removal of `www` though .htaccess, my base URL still had `www` in it. Removing that resolved the issue!  

---

