With .htaccess I'm trying to redirect all traffic away from a WordPress site, except traffic to wp-admin.
The goal is to redirect all traffic away from the site, but retain admin access.
I'm using .htaccess to do this, and it's working to an extent. But when trying to access wp-admin I get an internal server error.
The site is on a subdomain and this is my current code:
RewriteEngine on
RewriteCond %{HTTP_HOST} subdomain\.oldsite\.co\.uk$ [NC]
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule ^(.*)$ http://www.newsite.co.uk/$1 [R=301,L]
I'd be grateful for any insights.
subdomain.oldsite.co.uk
to redirect towww.newsite.co.uk
except when someone visitssubdomain.oldsite.co.uk/wp-admin
?