Because the rewrite rule above it says it uses the last rule to run if it matches (that is what [L] means). Put your new config above the WordPress rule.
- Y
Sent from a device with a very small keyboard and hyperactive autocorrect.
Hi all,
I´m having issues with a migration to a new domain redirecting all
URLs to the new domain.
My .htaccess looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
RewriteCond %{HTTP_HOST} ^oldomain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$
RewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=302,L]
For the time being I´m using a 302 redirect until I made sure it works.
My main problem is that if I tyope old.domain.com I get redirected to
www.newdomain.com. But if type some sections, I don´t get any redirection:
olddomain.com/team/
olddomain.com/contact/
etc
I have purged the Varnish cache in case there is any issue because the
only section that gets redirected is oldomain.com/wp-admin/ (which is
bypassed by Varnish).
I have Apache 2.4.18 from Cpanel and behind Varnish
Thanks,
Miguel
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx