Jump to content

Cloudflare & SSL in new subdomain


maicol07

Recommended Posts

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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by maicol07
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...