I need to redirect all php files from end of urls to a specif dir like:
http://example.com/dir/file.php
http://example.com/dir/folder/file.php
http://example.com/dir/folder/folder2/file.php
to
http://example.com/dir2/file.php
my code is
RewriteRule ^(.*).php$ http://example.com/dir2/$1.php [R=301,L]
but I'm getting
http://example.com/dir2//dir/file.php