简体   繁体   中英

Website keeps requesting a 301 URL address

My website is giving me a "This website is not secure" and I can't find the root of it, even though I double checked through everything to see if there are any http and switched them to https. I also have cloudflare forcing https.

1

I have checked the network tab and found one URL giving me trouble but it doesn't give me much information

2

The URL is giving a 301 moved permanently. I don't know where in my html I am requesting this site. I even used ctrl + f nothing showed up.

3

It's just requesting http://mywebsite.com/ but there is nothing I can see in my html requesting a http version of my site. I don't have anything that would cause my website to request http in .htaccess either.

RewriteEngine On
Options -Indexes
RewriteRule ^folder/?$ - [F]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.html [L]

ErrorDocument 403 /index.html 
ErrorDocument 404 /index.html 
ErrorDocument 500 /index.html 

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^/403/$
RewriteRule ^(.*)$ /index.html [L]

RewriteCond %{REQUEST_URI} ^/404/$
RewriteRule ^(.*)$ /index.html [L]

RewriteCond %{REQUEST_URI} ^/500/$
RewriteRule ^(.*)$ /index.html [L]

Is there something I'm missing?

I found the issue. It looks like it was jQuery that was requesting a http version of my site.

I couldn't ctrl + f it because it was a cloudflare jQuery link.

https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js

On line 2727 it was checking using http. (The picture shows https is because I just changed it) 1

The Fix


  1. Save the jQuery locally and change http to https.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM