maicol07 Posted July 20, 2019 Author Posted July 20, 2019 UPDATE: This is the new .htaccess: Header set Strict-Transport-Security "max-age=31536000" env=HTTPS ##### SSL ##### # Enable the Rewrite capabilities RewriteEngine On # Check if connection is not already HTTPS RewriteCond %{HTTPS} off # Whitelist well-known folder (AutoSSL) RewriteCond %{REQUEST_URI} !^/.well-known # Redirect users from their original location, to the same location but using HTTPS. # i.e. http://www.example.com/foo/ to https://www.example.com/foo/ RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} But there is a permanent redirect error... what can I do?
Sn1F3rt Posted July 20, 2019 Posted July 20, 2019 Do something rename your.htaccess file to htaccess.txt once.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 Do something rename your.htaccess file to htaccess.txt once.Site works but without htaccess rules there is no redirect
Sn1F3rt Posted July 20, 2019 Posted July 20, 2019 For https redirect: For HTML: (Add a meta tag) < meta http-equiv="Refresh" content="0;URL=https://www.example.com" /> For PHP: < ?php function redirectTohttps() { if($_SERVER['HTTPS']!=”on”) { $redirect= “https://”.$_SERVER['HTTP_HOST].$_SERVER['REQUEST_URI'];header(“Location:$redirect”); } } ?> Check my this post.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 Can I do this with .htaccess instead of in files?
Sn1F3rt Posted July 20, 2019 Posted July 20, 2019 No. As I posted in a previous post check what wolstech said. EDIT: Also can you temporarily disable Cloudflare totally on your site.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 (edited) What about WordPress? It gives the redirect error Edited July 20, 2019 by maicol07
Flaze Posted July 20, 2019 Posted July 20, 2019 The new .htaccess code looks fine. Try clearing your cache.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 U mean disabling Cloudflare?WordPress uses another htaccess in a subfolder to redirect users. The problem is that it gives the redirect error. I'm trying to set up a cloudflare page rule to exclude the .well-known folder
Flaze Posted July 20, 2019 Posted July 20, 2019 At this point, I would suggest disabling Cloudflare entirely. Why do you need it so much?
Sn1F3rt Posted July 20, 2019 Posted July 20, 2019 At this point, I would suggest disabling Cloudflare entirely. Why do you need it so much?Hmm flazepe....I was too suggesting him that....HSTS can be set up manually too, you don't need Cloudflare for that.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 (edited) At this point, I would suggest disabling Cloudflare entirely. Why do you need it so much?Speed improvements. As servers is located in California and I'm in Italy, I think Cloudflare can speed up page loading time. So the feature I need is the CDN one Edited July 20, 2019 by maicol07
wolstech Posted July 20, 2019 Posted July 20, 2019 Cloudflare and AutoSSL cannot coexist on our servers, so you may find yourself manually installing certificates if you use CF. Tommy is fast enough that you really don't need it anyway to be honest. It won't make much of a difference anyway unless you have lots of big pictures or something on them. It won't even help the speed of dynamic pages (php, etc.) because the scripts have to run every time they're visited. CF is more useful for Ricky and Johnny where the servers are painfully slow even for static content. Also, when troubleshooting this sort of thing, it's best to forget about forcing https entirely and just get the site to accept the connection. Rename the htaccess and get everything else working first.
maicol07 Posted July 20, 2019 Author Posted July 20, 2019 Ok, I've disabled cloudflare only for the updates subdomain to let AutoSSL issue the certificate. Now, if I go to updates.maicol07.it through plain HTTP it shows the Account Queued page...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now