301 redirect, conflicting with RewriteRule

Posted by user569711 on Stack Overflow See other posts from Stack Overflow or by user569711
Published on 2012-10-10T17:01:40Z Indexed on 2012/10/10 21:37 UTC
Read the original article Hit count: 154

Filed under:
|
|
|

We did some maintenance today, and moved our web forums from /forums into the root folder of the domain.

We put in a redirect 301 in a .htaccess file:

Redirect 301 /forums/ http://www.ourforums.com/

However, we used to have some links that contained duplicate /forums folders. I.e. www.ourforums.com/forums/forums/forum.1

Obviously the redirect from above now leads to /forum.1, which odes not exist. I would like the old link to actually point to www.ourforums.com/boards/forum.1. I attempted to use something like:

RewriteRule ^/forums/forums http://www.ourforums.com/boards/ [NC,R=301,L]

Regardless of what I tried though, the Redirect seems to supersede any RewriteRules I put in the same file, regardless of whether I place them before the Redirect.

Is there any way I can somehow ensure the RewriteRule is handled before the Redirect?

© Stack Overflow or respective owner

Related posts about apache

Related posts about .htaccess