Trying to redirect all paths on a subdomain (forum.rydercragie.com/whatever) to the root path (forum.rydercragie.com). Obviously I don’t want the root path to redirect as well. Just getting redirect loop errors in my browser for the root path. What am I doing wrong?
The rule you shared is causing the loop. You should forward from
forum.example.com/* to the destination of
https://example.com. The rule you shared is introducing the loop.
That rule is still directing users from
forum.example.com. Do you want visitors to go from
No. I’ve set up R3 hosting on forum.rydercragie.com with a file that is displayed on forum.rydercragie.com. So any paths on this subdomain result in a 404. To remove those 404’s I want to redirect all paths on forum.rydercragie.com back to forum.rydercragie.com. https://rydercragie.com or https://www.rydercragie.com in itself is out of the question.
Update: This is still an issue.
Your original rule was correct, and should work as intended. Please change the status code to something like 303, purge all cache after enabling it and see if it loops, If it does, check the headers to see whether all redirects are with status 303, or some other status code.
Just tried that. Still not working. It works for the URL “https://forum.rydercragie.com/*” with the asterix, but nothing else.
Do not use
* with Redirect Rules, they only work as wildcard in Page Rules.
You should go back to your original rule.
Do you have any other Redirect or Page Rules that might affect this hostname? How about Workers routes?
Good catch - yes. I had a Workers Route and a Configuration Rule. Now removed. Also cleared cache. Still not working. Is it because I’m using R2 on this subdomain?
Sorry, but I’m not familiar with R2. If this has a special procedure to purge cache, then try purging the cache for the “/” path.
Done. Still not working.
Check all rules (Redirect, Transform, Configuration, Page Rules etc.) that may apply to this hostname or to any hostname, as well as any rules that apply to the account, such as Bulk Redirects. Keep in mind that the rule should work (I tested it on a free-plan domain), so something else is making this redirect run twice.
Can’t find anything. Would be nice if there was a way to see everything applying to one URL/hostname in one place.
Agree, but… there isn’t. There won’t be anytime soon. So, check all your settings that could force a redirect, and review any Workers code, if applicable.
Still nothing. I’ll just point it to a third party hosting provider and use their tools to do it. Thank you for your help.