<p>Unless absolutely everything has been moved to <code>/uploads/</code> (which is unlikely), the easiest way to do it is with 3 regex's:</p>

<p><code>/hero/(.*)</code> -> <code>/uploads/hero/$1</code></p>

<p><code>/books/(.*)</code> -> <code>/uploads/books/$1</code></p>

<p><code>/slider/(.*)</code> -> <code>/uploads/slider/$1</code></p>

<p>vide: <a href="https://regexr.com/" rel="nofollow noreferrer">regexr.com</a></p>

CC BY-SA 4.0
2019-11-12T03:24:23.747Z
2019-11-12T03:24:23.747Z
andrew.welch
<p>I'm building out a new site and have moved all the existing client asset upload directories into one parent directory.</p>

<p>old site:</p>

<p><strong>/hero/</strong></p>

<p><strong>/books/</strong></p>

<p><strong>/slider/</strong></p>

<p>new site:</p>

<p><strong>/uploads/hero/</strong></p>

<p><strong>/uploads/books/</strong></p>

<p><strong>/uploads/slider/</strong></p>

<p>When adding a redirect in retour how can I set up a regex to catch all images/files in the various directories and point them at the new structure. </p>

<regex><plugin-retour>
Retour Regex to insert a new directory
# Retour Regex to insert a new directory

(Asked by: username_0 on 2019-11-04)

I'm building out a new site and have moved all the existing client asset upload directories into one parent directory.

old site:

**/hero/**

**/books/**

**/slider/**

new site:

**/uploads/hero/**

**/uploads/books/**

**/uploads/slider/**

When adding a redirect in retour how can I set up a regex to catch all images/files in the various directories and point them at the new structure.

**Tags:** regex, plugin-retour


---

## 1 answers

### Answer by username_1 on 2019-11-12. Score: 0 | Accepted answer

Unless absolutely everything has been moved to `/uploads/` (which is unlikely), the easiest way to do it is with 3 regex's:

`/hero/(.*)` -> `/uploads/hero/$1`

`/books/(.*)` -> `/uploads/books/$1`

`/slider/(.*)` -> `/uploads/slider/$1`

vide: [regexr.com](https://regexr.com/)


---

