Apache 网站文件夹没有完全的SSL锁
因此,我正在创建一个新网站,但由于某些原因,没有文件夹具有完整的SSL图标。顶级index.php文件具有锁,但try/blog文件夹中的任何内容都具有部分ssl。它有锁,但由于“有人可以更改此页面的外观”类型错误而将其隐藏。请帮忙,因为我不知道为什么会这样。我确实使用cloudflare,并且设置了一个*页面规则来强制https 更新:现在没有文件夹或文件具有完全锁定 对于任何感兴趣的人,以下是我的htaccess文件:Apache 网站文件夹没有完全的SSL锁,apache,.htaccess,ssl,cloudflare,Apache,.htaccess,Ssl,Cloudflare,因此,我正在创建一个新网站,但由于某些原因,没有文件夹具有完整的SSL图标。顶级index.php文件具有锁,但try/blog文件夹中的任何内容都具有部分ssl。它有锁,但由于“有人可以更改此页面的外观”类型错误而将其隐藏。请帮忙,因为我不知道为什么会这样。我确实使用cloudflare,并且设置了一个*页面规则来强制https 更新:现在没有文件夹或文件具有完全锁定 对于任何感兴趣的人,以下是我的htaccess文件: # Do not remove this line, otherwise
# 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]
ErrorDocument 404 http://qualexcraft.tk/404
目录结构:
index.php
404
资产
images
博客
包括
headers
head.html
index.html
layout
footer.html
navbar.html
地图
mdl
将favicon图像添加到favicon.ico、images/touch/ms-touch-icon-144x144-precomposed.png和images/android-desktop.png。这是唯一可以看到的不安全内容错误,因此,一旦修复了该错误,在清除浏览器缓存后,您应该不会有问题
为了在将来发现混合内容错误,您可以转到Chrome中的控制台(右键单击>检查元素>控制台),您的不安全内容错误将显示在那里。出现错误的原因之一是htaccess文件中的以下行:
# 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]
ErrorDocument 404 http://qualexcraft.tk/404
当客户端请求图像https://qualexcraft.tk/blog/images/android-desktop.png
,a302重定向到http://qualexcraft.tk/404
被触发。此页面的永久重定向设置为https://qualexcraft.tk/404
现在,正如我所问的,还有另一条规则,它在URL中添加一个尾随的/
,并将其重定向到http://qualexcraft.tk/404/
。最后是这个,;使用状态代码301重定向到安全页面:https://qualexcraft.tk/404/
中间重定向到http
页面是问题的根本原因。当有人访问您网站上的博客
链接时,也会发生同样的情况
请求https://qualexcraft.tk/blog
被重定向到http://qualexcraft.tk/blog/
然后转到https://qualexcraft.tk/blog/
在您更改网站后,行为仍然相同,只是请求现在为
https://qualexcraft.tk/favicon.ico
尝试将您的htaccess更新为以下内容:
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]
你的页面中没有很多链接。。。但是在你的
博客页面:http://placehold.it/512x176
改变它,使用https
或//placehold.it/512x176
试试/blog,它不起作用,在Chrome AtlastOK上,让我试试。问题是,在放置占位符之前它也不起作用。我的第二个编辑刚刚把它放进去了。试试我的/404文件夹,没有完整的SSL,有“人们可以更改内容”类型的东西。仍然不起作用。有什么想法吗?是的,我知道控制台部分,但奇怪的是上面写着“不安全的favicon:qualexcraft.tk/404”,你能解释一下吗?读上面。对不起,重复了,不是吗?是的,我在chrome中监控我的网络流量时观察到了404的相同行为。在重定向过程中,有一些404指向http
,而不是https
@Philippos Slicher尝试从页面中删除
代码,锁定图标会返回。如果这可以解决问题,那么上面帖子中的404相关建议应该可以解决问题。由于301重定向的缓存特性,请确保清除缓存。好的,我正在尝试。我正在添加图像,而不是删除该行。@hjpotter92那么我到底需要做什么?@hjpotter92等等,你在哪里看到了/blog/images/…。应该是/images/android……@PhilipposSlicher更新了上面的帖子。请查收
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]