All traffic will be directed from
https://oldsite.com/
to
https://www.newsite.com
I am looking for a 301 wildcard redirect solution for the following
https://oldsite.com/blog/*(the slug)
to
https://www.newsite.com/blog/*(matching slug)
Used htaccess file is:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
With your shown samples, please try following. Keep your domain redirection at the top of your htaccess file then keep other Rules. Also make sure to clear your browser cache before testing your URLs.