Post4VPS Forum | Free VPS Provider
Wordpress, Host or SSL - Printable Version

+- Post4VPS Forum | Free VPS Provider (https://post4vps.com)
+-- Forum: Geek World (https://post4vps.com/Forum-Geek-World)
+--- Forum: Scripting & Programming (https://post4vps.com/Forum-Scripting-Programming)
+--- Thread: Wordpress, Host or SSL (/Thread-Wordpress-Host-or-SSL)



Wordpress, Host or SSL - Rehan - 03-13-2019

Hello guys, i am facing some problems in hosting  my site. I am having problem in enabling ssl certificate.Today i shall explain everything.I am searching for this problem for 2 months.I am unable to find a perfect solution.
First i won a vps from Post4VPS giveaway and i hosted a wordpress site on it.I used letsencrypt for a ssl certificate.It was working well.After a month on the next giveaway i won a vps9 and i transferred my website from previous host to new one.I tried enabling ssl certificate but it shows " error too many redirects " i searched google and found different solutions i tried all of those but nothing works.I  waited one month and applied for vps1 again and got my previous vps with same ip.I re-transferred my website and enabled ssl.it was showing too many redirects.I updated all urls with the help of a wordpress tool ( wp-cli ).After updating i checked site was working well.I thought that i found the problem and i should withdraw my vps1 request and use older vps9.After withdrawing app i tried same method on vps9 and tried same method but still it was showing " error too many redirects ".I searched google and found some methods.I tried all of those methods but nothing worked.I thought that may be the problem is in host.This month i re-applied for vps1 and found  a vps1 but with different ip address.I transferred my website on new vps and tried enabling ssl but still it is showing error.I tried all of the methods one by one but nothing works.After thinking a lot i thought that it may be a problem in my backup.I re-installed vps OS and installed a new wordpress site and enabled letsencrypt ssl but still showing the same error.It was my last effort.  Eh  Crazy

So now i am asking here if someone know the solution.

Host OS : Ubuntu 18.0 ( Apache2, PHP7.0, MySQL Server, PhpmyAdmin ) also i have tried Debian
SSL Provider : LetsEncrypt
I am using CloudFlare for pointing domain with VPS.


RE: Wordpress, Host or SSL - rudra - 03-13-2019

My first guess is you have mixed up Wordpress adress and site address under general settings in wordpress.

Or may be your vhost setting is forcing to an url but that is in conflict with wordpress url in settings.

Here is what i suggest you do...

Say you want to visit your wp site at 
Code:
https://www.google.com
and you want 
Code:
https://google.com
and http of the both of them to redirect to
Code:
https://www.google.com
.

Then make sure you have 
Code:
https://www.google.com
in both url space under your wordpress general settings. If you cant access then go to wp-config.php and change as

Code:
define('WP_HOME','https://www.google.com');
define('WP_SITEURL','https://www.google.com');


Next,
check nginx.conf or the webserver settings file where you have your vhost settings and make sure your site is at www dot google dot com listening to port 443 using ssl

For nginx,

Code:
server {
  listen              443 ssl;
  server_name         www.google.com;
......


Also make sure your redirects are ok.

Then clear your browser cache and cookies and enjoy.


RE: Wordpress, Host or SSL - Rehan - 03-13-2019

(03-13-2019, 12:38 PM)rudra Wrote: My first guess is you have mixed up Wordpress adress and site address under general settings in wordpress.

Or may be your vhost setting is forcing to an url but that is in conflict with wordpress url in settings.

Here is what i suggest you do...

I think the problem is in wordpress.I have tried installing SMF and enabling ssl and it is working well.Now i am going to install wordpress older version for a test.


RE: Wordpress, Host or SSL - tiwil - 03-13-2019

Actually, why you should use Lets encrypt while you already have Cloudflare SSL?

And, try to turn off Cloudflare DNS then do lets encrypt once again. If you turn Cloudflare DNS on, then the lets encrypt is trying to contact with Cloudflare's DNS.


RE: Wordpress, Host or SSL - Rehan - 03-13-2019

(03-13-2019, 12:53 PM)tiwil Wrote: Actually, why you should use Lets encrypt while you already have Cloudflare SSL?

And, try to turn off Cloudflare DNS then do lets encrypt once again. If you turn Cloudflare DNS on, then the lets encrypt is trying to contact with Cloudflare's DNS.

cloudflare ssl does not works well.Also i do understand what you said. about turning cloudflare off.How will i use host if i disable cloudflare?


RE: Wordpress, Host or SSL - rudra - 03-13-2019

(03-13-2019, 12:53 PM)tiwil Wrote: Actually, why you should use Lets encrypt while you already have Cloudflare SSL?

And, try to turn off Cloudflare DNS then do lets encrypt once again. If you turn Cloudflare DNS on, then the lets encrypt is trying to contact with Cloudflare's DNS.

thats kinda mixed up.

DNS and SSL are not the same. As I'm sure you all know. One can use Cloudflare DNS with either Letsencrypt ssl or cloudflare ssl. Just dont use both.
Actually you can use both too. You can configure that way and then cloudflare backend will talk to your server using letsencrypt ssl cert over https instead of plain http and you viewers will see cloudflare ssl cert on your site.

@Rehan

I updated. check my post above now.

The reason may also be a faulty plugin or .htaccess . But we will go there if the above solutions dont work.

let us know.


RE: Wordpress, Host or SSL - tiwil - 03-13-2019

(03-13-2019, 01:01 PM)rudra Wrote: thats kinda mixed up.

DNS and SSL are not the same. As I'm sure you all know. One can use Cloudflare DNS with either Letsencrypt ssl or cloudflare ssl. Just dont use both.
Actually you can use both too. You can configure that way and then cloudflare backend will talk to your server using letsencrypt ssl cert over https instead of plain http and you viewers will see cloudflare ssl cert on your site.

Nah, I mean, why @Rehan should use Lets encrypt SSL while Cloudflare already have one. Then he said Cloudflare also have problem.

How about directing your domain direct to your VPS instead of using Cloudflare? Sometimes cloudflare also broke my DNS and I can't use my website while using their DNS.

If doing direct to VPS not working also, I guess it's not DNS problem.

Edit: Do you use panel or doing the installation by your own hand?


RE: Wordpress, Host or SSL - Rehan - 03-13-2019

(03-13-2019, 01:01 PM)rudra Wrote: thats kinda mixed up.

DNS and SSL are not the same. As I'm sure you all know. One can use Cloudflare DNS with either Letsencrypt ssl or cloudflare ssl. Just dont use both.
Actually you can use both too. You can configure that way and then cloudflare backend will talk to your server using letsencrypt ssl cert over https instead of plain http and you viewers will see cloudflare ssl cert on your site.

@Rehan

I updated. check my post above now.

The reason may also be a faulty plugin or .htaccess . But we will go there if the  above solutions dont work.

let us know.

Well @rudra you are right both were enabled.I have tried not by disabling the cloudflare and it is working fine now so let me try again by installing the old backup.


RE: Wordpress, Host or SSL - rudra - 03-13-2019

that point was first raised by tiwil above, albeit in a somewhat mixed way. But I guess it was more problem of expression than understanding on his part. So if turning one ssl off was the solution then he is the one deserving our thanks here.

but i do say again @tiwil @Rehan
you can keep both ssl on if configured right.
Just use Cloudflare Full or Full strict mode.

if cloudflare Ssl is in flexible mode then make sure your server does not redirect http to https. or you get loop too. cause CF Flexible mode expects http traffic from (your )origin servers.

Keeping both SSL on makes both half secured by https (with the assumption that we believe in CF not tampering anything in the middle and or CF not getting hacked and as a result letting the hacker tamper it).

Also remember to make sure that it is either www(.)siteurl(.)com or without www in all places and that vhost redirects and wordpress url settings are in order. Think about the request reply chains in mind.

source.
https://support.cloudflare.com/hc/en-us/articles/115000219871-Why-do-I-see-redirect-loop-errors-