This rule is working, and directs any visits to the root domain to the www version.
It also redirects any visits to /foo/bar to www.mydomain.com, which is exactly what I want to happen. Everything to the one base URL.
However, I would also like to redirect any visits to www.mydomain.com/foo/bar, so if anyone visits any of the old WordPress paths AND uses the www subdomain, they’ll also just get redirected to www.mydomain.com
I’ve fiddled around with additional page rules and redirects but I can’t seem to find the right method to add this additional “wildcard” behavior without disrupting what I’ve already got working. I’ve reviewed the CF documentation for all these areas but I can’t seem to figure out how to apply those examples to my situation.
Any suggestions would be greatly appreciated. Thanks!
Domains like e.g. example.com, example.net and example.org are standardized as example domains, such as for use in e.g. documentation, and, like in your case if you are not actually sharing a real domain name.
You can use Redirect Rules (rather than Page Rules), which would offer much more granularity.
which would redirect both https://example.net and https://www.example.net, but only with the URI PATH /foo/bar to https://example.com
The different variables and such you can use, would be available here:
I’m not sure that I’m catching the part about “wildcard”, as it also sounds like you want to be very selective with what you are redirecting?
So I guess the best way would be, if you would elaborate what exact stuff that you do already have working, that you don’t actually want to disrupt, including what exact rules you tried, that was disrupting what you had already?
If you are looking to redirect /foo/bar alone, and only on the www. hostname, you can do that with a Redirect Rules, like this:
Thank you very much for the notes so far. I think I may have misused “/foo/bar” in my original post, in that I think it may have communicated I want to redirect one particular path, or perhaps even a fixed set of particular paths.
Rather, I am hoping to redirect all URLs from the old iteration of the website to just land on the new “home” page.
What I’m hoping to have happen is that visits to any of the following URLs will get redirected to https://www.example.com/
Any other substitute in place of “blog” or “article” in the examples above. This is what I meant about a “wildcard” kind of effect, I just didn’t know how to express it. Essentially, I’m hoping to come up with something where everything after https://www.example.com/ in the URL gets ignored or in a way, stripped.
As of right now, from the list above the following items are working as desired: 1, 2, and 4.
The following items are not working: 3, 5, and 6.
At this time, what I have in place are a DNS A record for @ and a CNAME record for WWW.
And I have one page rule in place as follows: https://example.com/* - Forwarding URL (Status Code: 301 - Permanent Redirect, Url: https://www.example.com/ )
It seems like items 3, 5, and 6 may all be examples of the same problem, I just can’t figure out how to implement a rule to address it without getting into redirect loop trouble.
I hope this clarifies the problem. Thank you again for the notes so far, and I’m going to review those in more detail later to learn all that I can. It seems like your last example of the dynamic AND rule may be very close to what I will need to implement, but because of the confusion I caused with my use of foo/bar I’m not sure…