Dumb SEO Questions

(Entry was posted by Kiersten Megli on this post in the Dumb SEO Questions community on Facebook, 02/21/2014).

Is there a way to redirect that entire category without writing a Redirect 301 for each individual page?

Hey All,
Hopefully someone can help answer this question. We are needing to redirect a group of over 160 pages that are all in one category so their URLs are all mysite.com/articles/name-of-article/. Is there a way to redirect that entire category without writing a Redirect 301 for each individual page??
This question begins at 01:37:12 into the clip. Did this video clip play correctly? Watch this question on YouTube commencing at 01:37:12
Video would not load
I see YouTube error message
I see static
Video clip did not start at this question

YOUR ANSWERS

Selected answers from the Dumb SEO Questions Facebook & G+ community.

  • Kiersten Megli: Hey All,
    Hopefully someone can help answer this question. We are needing to redirect a group of over 160 pages that are all in one category so their URLs are all mysite.com/articles/name-of-article/. Is there a way to redirect that entire category without writing a Redirect 301 for each individual page?
  • Thai Bui: Assuming that you're using Apache's .htaccess. Try this:
    RewriteRule ^articles/([a-z-]+)/$ new-articles/$1 [R=301,L]
  • Mark Steenbakkers: Hi +Kiersten Megli what CMS system are you using? Joomla, WordPress? Did you install a SEF plugin?
  • Kiersten Megli: It's on WordPress
  • Mark Steenbakkers: The solution +Thai Bui gave you should work. If you add a rewrite rule in the .htaccess file ensure that you add it before any SEF rewrites.
  • Tony McCreath: Make sure you place +Thai Bui ;s code after the line:

    RewriteEngine On

    And before the WordPress code.

    As an alternative with WordPress I use the Redirection plugin. It's simpler to use and makes redirections more manageable. For the above example you should be able to use:

    Source: ^articles/([a-z-]+)/$
    Target: ;new-articles/$1
  • Thai Bui: +Kiersten Megli ; ;Those redirect plugins for Wordpress is your best option. You can use that rule and don't have to worry about fiddling with the file as much. It takes a few trial and errors but try a few out to see which ones you like.

View original question in the Dumb SEO Questions community on Facebook, 02/21/2014).

All Questions in this Hangout