Redirect Subdirectories to the Root Directory using .htaccess

Suppose “block” is a sub directory in the domain “domain.com”, so you can redirect the sub directory to the root directory as follows.

RedirectMatch 301 ^/block/$ http://domain.com/

Leave a Reply

Your email address will not be published. Required fields are marked *