Forward all post from old blog to new one

Hi

I did a lot of forward 301 at Page Rules. But now I need to do something more general, like:

Old blog: https://blog.mydomain.com

New blog: http://www.mydomain.com/blog

The problem is the blog have more then 200 posts, so I need a regex or something like that to redirect by pages rules all request to old blog to new one

Old blog: https://blog.mydomain.com/howto/
Old blog: https://blog.mydomain.com/howto/mypost

New blog: http://www.mydomain.com/blog/howto
New blog: http://www.mydomain.com/blog/mypost

I want to delete old blog and server, so I can’t do this at htaccess.

Regards

Seems like a page rule would still suffice.

When working with wildcards “*” and page rules, the first wildcard can be put into the “forwarding URL” by using the token “$1”. Similarly, future wildcards can be represented by adding 1 to the number, eg. the second wildcard is “$2”, third “$3”, etc.

For your situation, you could make page rule with:

Matching URL: https://blog.example.com/*

with a “forwarding url” - 301 redirect - pointing to: https://www.example.com/blog/$1

This does what you want - Cloudflare will handle redirecting the URL of the blog subdomain to the subdirectory-type setup.

With this:

https://blog.example.com/post-first redirects to: https://www.example.com/blog/post-first.