Forum
Perch 2.0.4 SSL
My client is running a very old version of Perch (2.0.4) and recently bought and installed an SSL cert. When the following is added to the .htaccess file:
#RewriteEngine On
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://somesite.com/$1 [R=301,L]
the resources (images and videos) that were previously embedded/uploaded via the Perch UI display fine, but any images outside of Perch, i.e., referenced from the stylesheet or hard-coded in a template, do not display.
External files (stylesheets, js) are referenced in the head tag like this:
<link rel="stylesheet" type="text/css" media="screen" href="/css/global.css" />
<script type="text/javascript" src="/js/global/external.js" language="javascript"></script>
What am I missing?
When visiting the site with
https://
the browser will block any resources (internal or external) that start withhttps://
to keep the connection secure.Right, I understand that part.
But even when I use the full url to say, the stylesheet,
the images (referenced in the stylesheet) still do not appear. Why is that? What's the solution?
How are the images referenced in the stylesheet - can you post an example?
I would expect the browser to load that. Are there any references to resources with https:// within the stylesheet?
The browser inspector show what mixed content is not being allowed to show.
The images in the stylesheet are referenced like this:
If you right-click and choose 'inspect' on an image that is missing what does the browser say?
Here's the error:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (hotlinkp.gif, line 0)
and next to the above error is this:
https://img148.imageshack.us/img148/732/hotlinkp.gif
I have absolutely no idea what the “imageshack” stuff is about.
It's the same for every missing image.
Solved.
Found a problem in the .htaccess.
Great. What was the problem?
There was an unknown .htaccess file in the folder containing the images that had something to do with the imageshack error above. Looks like it might have been auto-created by the server to prevent hotlinking. I know I didn't put it there.
It was blocking the images from rendering.