Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I am trying to correct for an issue where some dynamic urls were generated where the downstream directory paths were swapped with what is normal and then the links were published.

For example: example.com/en/2014_01/en-directory-01/... was created as example.com/es/2014_01/es-directory-01/...

I have a whole slew of these where the en/ directory is accidentally paired with a es-directory-#/ directory.

I have created a set of rewrite rules that I think cover them but don't seem to work. The format is:

RewriteRule ^en/(201[0-4]_[0-9]{2})/es-directory-01/(.*)?$ es/201$1/es-directory-01/$2 [R=301,NC]
RewriteRule ^en/(201[0-4]_[0-9]{2})/es-directory-02/(.*)?$ es/201$1/es-directory-02/$2 [R=301,NC]
...
RewriteRule ^es/201([0-4]_[0-9]{2})/en-directory-01/(.*)?$ en/201$1/en-directory-01/$2 [R=301,NC]
RewriteRule ^es/201([0-4]_[0-9]{2})/en-directory-01/(.*)?$ en/201$1/en-directory-01/$2 [R=301,NC]
...

I don't need a rewrite condition for this, correct? Is there anything obviously wrong here?

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.