WordPress redirect all pages to homepage using htaccess

We can redirect all the pages of WordPress website to home page by using the htaccees
Here’s our example: If you want redirect old-website.com/blog/post to new-website.com/ along with all the other posts that use that same URL format.

# BEGIN redirect to homepage
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/$
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png|css|js|php)$
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule .* / [L,R=301]
#END redirect to homepage

Leave a Reply

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