Reputation: 527
I have a centos server and i'd like to rewrite the url in this way:
Example
From:
/lang/"folder1"/"folder2"/"filename_n.php"
to:
/lang/filename_n.php
From:
/lang/"folder1"/"folder2"/"folder3"/"filename_n.php"
to:
/lang/filename_n.php
The folder "lang" is static while the other folders and file name change.
Very thank's :-D
Upvotes: 1
Views: 29
Reputation: 785266
You can use this rule in root .htaccess:
RewriteEngine On
RewriteRule ^lang/(?:[^/]+/)+([^/]+)$ lang/$1 [L]
Upvotes: 1