I create some rules:
RewriteEngine On
RewriteBase /
RewriteRule ^dir1/dir2/(.*).html$ /dir2/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
My old links was look that: http://example.org/app_name/dir1/dir2/slug.html
, but new links will be looks like: http://example.org/app_name/dir2/slug
My redirection works almost good but new links redirect to http://example.org/dir2/slug
(without app_name/)
How to add app_name/ dir to redirection dynamicaly?
Soluttion below it's not good:
RewriteRule ^dir1/dir2/(.*).html$ /app_name/dir2/$1 [R=301,L]