Redirect to different domain and URI


I need to be able to redirect dynamically a few pages from one domain to a different domain and URI.
Example: to

Basically removing the subdirectory on the new domain.

My google-fu isn’t working to find a way do this.

To redirect from to, you can use Cloudflare Page Rules:

  1. Log in to your Cloudflare account.
  2. Go to the Page Rules app.
  3. Click “Create Page Rule” for
  4. Set the target URL to*.
  5. Choose the “Forwarding URL” setting and select “301 - Permanent Redirect”.
  6. Set the destination URL to$1.php, where $1 represents the wildcard match from the original URL.
  7. Save and deploy the rule.

This will redirect all pages from the specified subdirectory in to the same page in without the subdirectory.