0

I would like to redirect an entire WordPress sites (posts, pages, categories etc) from one sub directory (blog) to another (news) but excluding /wp-admin/ directory and the /wp-login.php file.

I have tried the following, but that obviously redirects the whole site.

RedirectMatch 301 /blog(.*) /news$1

How would I go about doing this?

Thanks!

1 Answer 1

-2

You could try this:

RewriteCond %{REQUEST_URI} !^/wp-admin
RewriteCond %{REQUEST_URI} !^/wp-login\.php(.*)$
RewriteRule ^blog/(.*)$ /news/$1 [R=301,NC,L]
1
  • 1
    Please edit your answer, and add an explanation: why could that solve the problem?
    – fuxia
    Jul 7, 2016 at 22:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.