How to redirect non existent pages/posts in wordpress using htaccess

Question

How can I redirect non existent pages/posts in WordPress using only .htaccess file?

Here is my code:

<IfModule mod_rewrite.c>

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteRule ^products/cool-tshirt$ /tshirts [R=301,L]

</IfModule>

Thank you in advance.

0
N. Kirk 3 months 0 Answers 13 views 0

Leave an answer