Need help with redirects.

This question is in relation to Cloudflare pages, probably using the Github integration. If I wanted visitors to example.com + www.example.com permanently redirected to a subpath such as example.com/sub what would be the best way to do it? I have found the 2 dev links below but I'm not sure what approach to take. (1) https://developers.cloudflare.com/pages/configuration/redirects/ (2) https://developers.cloudflare.com/rules/url-forwarding/
Cloudflare Docs
Redirects · Cloudflare Pages docs
To use redirects on Cloudflare Pages, declare your redirects in a plain text file called _redirects without a file extension, in the output folder of …
Cloudflare Docs
Redirects · Cloudflare Rules docs
URL forwarding, also known as URL redirection, navigates the user from a source URL to a target URL with a specific HTTP status code.
3 Replies
arcorun
arcorunOP•7mo ago
Last check on if anyone can help on this? ... I'll leave everyone alone then 🙂
Cyb3r-Jak3
Cyb3r-Jak3•7mo ago
Depends on your use case. If you are looking for something like sub1.example.com to be redirected to example.com/sub1 and sub2.example.com to be redirected to example.com/sub2 then you need single redirects. It sounds like you want static so example.com and www.example.com are redirected to a single source, in which case I would recommend bulk redirects
arcorun
arcorunOP•7mo ago
@Cyb3r-Jok3 Great, thank you very much!
Want results from more Discord servers?
Add your server