301 Redirecting all pages on Subdirectory

by Daones
2 replies
Hi,

So I have a client who no longer wants their blog active, so their site has 160 pages not found all of the blog posts.

So basically I want to redirect everything located under /blog to the root domain. The issue is it is only stripping the /blog from the address but keeping intact actual blog post URLs.

Example:
.com/blog/beach-cleanup-september-19/
.com/blog/crazy-communidad-party-friday-jan-22/

It only removed the /blog from the above addresses so its still a 404.

What rule is it to redirect and match everything beyond /blog to redirect it to the root domain?

I already tried adding this:

RedirectMatch permanent ^/blog/(.*)$ domain.com
#301 #pages #redirecting #subdirectory

Trending Topics