Cloudflare on redirected URL


#1

My website is example.com. This redirects through my Cpanel to my wordpress installation to example.com/worpress (on the same server, in the root of example.com).

After redirecting example.com to Cloudflare when going to example.com it no longer redirects to example.com/worpress but merely shows the index of example.com

Clearly I did something wrong in the setup or need to add a page rule and have spent two days trying to find the answer but cannot find the solution. Every example seems to be the other way round i.e. example.com/wordpress redirecting to example.com.

Please can someone help me, I am a newbie and me head is spinning from all the permutations.
Thank you.


#2

If you have pointed the A record to your server with cPanel and it worked before, then your redirect should still take place (I do this all the time). What is the domain?


#3

Kropinski.net is the domain. It redirects to kropinski.net/portfolio

Thank you!


#4

If you pause Cloudflare, does the redirect work?


#5

Thank you. I have paused it and it makes no difference.


#6

This means that it is not caused by Cloudflare being enabled, it is either a DNS problem (I doubt it) or a cPanel issue.

Make sure that all the DNS records from your cPanel are copied over correctly to Cloudflare (I don’t think this will be the issue) and check the redirect on cPanel… Not a lot else I can suggest really… Sorry!

Did the redirect definitely work before you changed the nameservers to Cloudflare?


#7

Thank you DomJH. I really appreciate your input. Could it possible be a setting in W3 Total Cache on my site?
When testing with speedinsight before configuring W3 Total cache I believe the redirect was working because I got a very slow speed. After configuring W3TC the speed is now 100% indicating that only the front page is loading. Do you know of a definitive W3 TC and Cloudflare setup you can refer me to? I followed several different ones and amalgamated their wisdom which seems to be fairly common but perhaps there is something unique about configuring a redirected site?


#8

On and yes - the redirect worked for several years before adding W3TC and Cloudflare.


#9

It shouldn’t be a caching issue with a wordpress plugin as the redirect is on the server before you get to the WordPress installation.

It should work if it did before as long as the DNS is configured correctly… I can’t think of a reason why it wouldn’t but someone else on here may be able to come up with one!

You could set the redirect up with a CF page rule, but I can’t see a reason why it wouldn’t work doing it with cPanel!!

https://support.cloudflare.com/hc/en-us/articles/200172286-How-do-I-perform-URL-forwarding-or-redirects-with-Cloudflare-

Sorry I can’t be of more help!


#10

Domjh you have actually been of ENORMOUS help!
Your suggestion of it being a faulty redirect prompted me to check the redirect settings in the Cpanel and for some inexplicable reason the reirect had been removed! Seems very odd because as I said it’s been running like that since around 2005 or so! They did recently move servers so perhaps the setting changed or was deleted.

I can’t thank you enough! It has been two days of absolute hell.


#11

No problem! Glad you got it sorted :slight_smile:


#12

One final question if I may: will that redirected URL
http://kropinski.net/portfolio/ cache in Cloudflare? I wasn’t sure how to include it with the page rules or even if I need to.


#13

It should follow all the same caching rules as the root domain, so static content will be cached by default if the domain is set to :orange:.


#14

Thanks again! Greatly appreciated.