Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Website folders do not have full SSL lock

So I am making a new website, Link, but for some reason no folders have the full SSL icon. The top-level index.php file has the lock, but anything inside a folder, try /blog, has partial-ssl. It has the lock, but hides it because of the "Someone can change the look of this page" type error. Please help, as I do not know why this is hapenning. I do use cloudflare, and have set a http://qualexcraft.tk/* page rule to force https.

UPDATE: Now no folders or files have the full lock

For anyone interested, here is my htaccess file:

# Do not remove this line, otherwise mod_rewrite rules will stop working
RewriteBase /
ErrorDocument 404 http://qualexcraft.tk/404
# Redirect www urls to non-www
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.qualexcraft\.tk [NC]
RewriteRule (.*) https://qualexcraft.tk/$1 [R=301,L]

Directory Structure:

index.php

404

index.php

old.php

assets

images

blog

allPosts

index.php

includes

headers

  head.html

  index.html

layout

  footer.html

  navbar.html

maps

mdl

[mdl files]
like image 859
Philippos Slicher Avatar asked Nov 09 '15 17:11

Philippos Slicher


1 Answers

One of the reasons for the bahaviour is the following line in your htaccess file:

ErrorDocument 404 http://qualexcraft.tk/404

When the client requests for the image https://qualexcraft.tk/blog/images/android-desktop.png, a 302 redirection to http://qualexcraft.tk/404 is triggered. This page, in turn, has a permanent redirection set to https://qualexcraft.tk/404.

Now, as I asked in the comment, there is another rule which adds a trailing / in the URLs and redirects it to http://qualexcraft.tk/404/. This, lastly; redirects with the status code 301 to the secure page: https://qualexcraft.tk/404/.

The intermediate redirects to http pages is the root cause of your problem. The same occurs when someone visits the blog link on your website.

The request to https://qualexcraft.tk/blog gets redirected to http://qualexcraft.tk/blog/ and then to https://qualexcraft.tk/blog/.


After your changes to the website, the behaviour is still the same, except that the request is now for https://qualexcraft.tk/favicon.ico.


Try updating your htaccess to the following:

Options -MultiViews
DirectorySlash Off
ErrorDocument 404 https://qualexcraft.tk/404

RewriteEngine on
RewriteBase /

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+)/?$ $1/index.php [L]

RewriteCond %{HTTP_HOST} ^www\.qualexcraft\.tk [NC]
RewriteRule (.*) https://qualexcraft.tk/$1 [R=301,L]
like image 113
hjpotter92 Avatar answered Sep 29 '22 12:09

hjpotter92