Forum Topic: How to redirect pages that have multiple URL possibilitiess?
I’ve helped a client migrate their website from Joomla to WordPress and am trying to set up redirects for the various pages to their new URLs. The Joomla installation was set to add a
.html extension, so there are pages that are indexed with and without
There’s also some URLs that have
9-uncategorised added to them so that I get a situation like:
/calcium/calcium-rich-foods /calcium/calcium-rich-foods.html /calcium/calcium-rich-foods/9-uncategorised /calcium/calcium-rich-foods/9-uncategorised.html
All of which should be redirected to the new URL:
I’m not sure what the best way of setting this up is. I’ve tried:
RedirectMatch 301 /calcium/calcium-rich-foods http://example.com/ingredients/calcium/calcium-rich-foods/
And that works for the 4 example links above, but I guess I have to then add individual Redirect 301 rules for
as setting up a RedirectMatch for those causes any of the child pages of
/calcium to redirect to the parent page, regardless of which order the redirects are listed.
Any suggestions would be appreciated.
2 Replies to “How to redirect pages that have multiple URL …”
So just to understand correctly, the following URLs:
/calcium /calcium.html /calcium/calcium-rich-foods /calcium/calcium-rich-foods.html /calcium/calcium-rich-foods/9-uncategorised /calcium/calcium-rich-foods/9-uncategorised.html
..all need redirected to this:
If so, then something like this would work:
RedirectMatch 301 /calcium http://example.com/ingredients/calcium/calcium-rich-foods/
If not, you could set up a separate redirect for
Thanks for the reply.
Wasn’t able to set it up that way, as
/calcium was and still needed to be a separate page from
I just ended up not creating redirects for the parent pages/categories without the