I am using WordPress 5.3.
I changed the URL of my site from example.com to example2.com. I want all example.com URLs to redirect to example2.com. Here is an example:
example.com/blog redirect to example2.com/blog
Can I add a redirect rule in WordPress? Here is my .htaaccess file:
# BEGIN WordPress
<IfModule mod_headers.c>
Header set Connection keep-alive
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(.*)$ http://www.example2.com/$1 [R=301,L]
</IfModule>
# END WordPress