I finally found the solution:
RewriteCond %{REQUEST_URI} old/?(.*)
RewriteRule ^ /%1 [L,QSA]
# redirect requests from / to /new/
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ new/ [L,R=302,QSA]
# redirect requests from /..... to /new/.....
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !old/?
RewriteCond %{REQUEST_URI} !new/?
RewriteRule ^(.*) new/$1 [L,R=302,QSA]
Unfortunately, this is not the best solution, since requests to /a.php
will return the /a.php
, instead of /new/a.php
, but requests to /b.php
will redirect to /new/b.php
and requests to /old/a.php
will return /a.php