mod_rewrite add and switch directory
- by Markus
How to change the url pattern with mod_rewrite first from
domain.de/images/myfile.jpg
to
domain.de/directory/images/myfile.jpg
and then finally to
domain.de/images/directory/myfile.jpg
My rules so far
RewriteCond %{HTTP_HOST} ^(www\.)?domain\.de$
RewriteCond %{REQUEST_URI} !^\/directory
RewriteRule ^(.*)$ directory/$1 [NC]
RewriteCond %{REQUEST_URI} ^\/directory\/images
RewriteRule ^\/directory\/images\/(.*)$ images/directory/$1 [qsappend,L]
The first part is working but the exchange of directory fails