Jump to content


Photo

Cloudflare & SSL in new subdomain

cloudflare ssl subdomain

  • Please log in to reply
34 replies to this topic

#16 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 12:45 PM

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?


Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#17 sohamb03

sohamb03

    Rank VII Member

  • Members
  • PipPipPipPipPipPipPip
  • 617 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 20 July 2019 - 12:56 PM

Do something rename your.htaccess file to htaccess.txt once.

Sayan Bhattacharyya


#18 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 12:58 PM

Do something rename your.htaccess file to htaccess.txt once.

Site works but without htaccess rules there is no redirect


Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#19 sohamb03

sohamb03

    Rank VII Member

  • Members
  • PipPipPipPipPipPipPip
  • 617 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 20 July 2019 - 01:00 PM

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.

Sayan Bhattacharyya


#20 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 01:01 PM

Can I do this with .htaccess instead of in files?


Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#21 sohamb03

sohamb03

    Rank VII Member

  • Members
  • PipPipPipPipPipPipPip
  • 617 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 20 July 2019 - 01:02 PM

No. As I posted in a previous post check what wolstech said.

EDIT: Also can you temporarily disable Cloudflare totally on your site.

Sayan Bhattacharyya


#22 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 01:03 PM

What about WordPress? It gives the redirect error


Edited by maicol07, 20 July 2019 - 01:04 PM.

Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#23 sohamb03

sohamb03

    Rank VII Member

  • Members
  • PipPipPipPipPipPipPip
  • 617 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 20 July 2019 - 01:07 PM

U mean disabling Cloudflare?

Sayan Bhattacharyya


#24 flazepe

flazepe

    Rank VIII Member

  • Moderators
  • 705 posts
  • Gender:Male

Posted 20 July 2019 - 01:12 PM

The new .htaccess code looks fine. Try clearing your cache.



#25 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 01:17 PM

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


Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#26 flazepe

flazepe

    Rank VIII Member

  • Moderators
  • 705 posts
  • Gender:Male

Posted 20 July 2019 - 01:19 PM

At this point, I would suggest disabling Cloudflare entirely. Why do you need it so much?



#27 sohamb03

sohamb03

    Rank VII Member

  • Members
  • PipPipPipPipPipPipPip
  • 617 posts
  • Gender:Male
  • Location:India
  • Interests:Web Designing

Posted 20 July 2019 - 01:25 PM

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.

Sayan Bhattacharyya


#28 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 01:28 PM

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, 20 July 2019 - 01:29 PM.

Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog


#29 wolstech

wolstech

    Rank X Member

  • Root Admin
  • 10,774 posts
  • Gender:Male
  • Location:Pennsylvania

Posted 20 July 2019 - 01:32 PM

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.

Please do not PM me for support. Posting on our forums lets all of us learn.
Do you play Minecraft? | Server Monitors | And the Dumbass of the Decade award goes to...


#30 maicol07

maicol07

    Rank IV Member

  • Members
  • PipPipPipPip
  • 224 posts
  • Gender:Male
  • Location:Italy
  • Interests:Python, Android, Windows, HTML, PHP, JS, WordPress

Posted 20 July 2019 - 01:39 PM

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


Python, Android and web developer.

Check me out:

My website
My apps website

My GPlay Developer Page

Blog






Also tagged with one or more of these keywords: cloudflare, ssl, subdomain

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users