I try to Redirect from old domain to new domain, By below code, but not work, Where is error.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www.mydomain.com$
RewriteRule ^/?$ "http://mydomain.com/" [R=301,L]
</IfModule>
# END WordPress
You need to place redirect rule before WP catch-all rule otherwise you will only get
index.php
after redirect on new domain: