Here is a good way to globally redirect a subdirectory and anything that follows to a final destination.
originasite.com/first-folder/other-folder/slug-here/
originasite.com/first-folder/other-folder/other-slug-here/
would be redirected to
finalsite.com/new-location/
Source: ^/first-folder/other-folder/.+
Destination: https://www.finalsite.com/new-location/
Carryover the Path
If you want to preserve the part you are redirecting and it go to an equivalent page you would use:
Source: ^/first-folder/other-folder/(.+)
Destination: https://www.finalsite.com/new-location/$1
Further Reading and Tools
- See all our Redirect posts
- Redirect Checker – useful for avoiding browser cache misdiagnosis when testing redirects
- WPENGINE Advanced Rewrite Options
- WPENGINE – Common RegEx Used for Redirect Rules and SSL