htaccess rewrite url remove subdirectory

I'm trying to rewrite

http://www.example.com/directory/folder/*

to

http://www.example.com/directory/*

the htaccess file is in directory

this is my .htaccess file :

RewriteEngine on
RewriteBase /directory/
RewriteRule ^(.*)$ folder/$1 [L]

Any help would be much appreciated.


Solution 1:

This is what I ended up doing :

Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !(.*)folder 
RewriteRule ^(.*)$ folder/$1 [L]

Solution 2:

What about this?

RewriteEngine on
RewriteRule ^folder/(.*) /directory/$1 [L]

Or you can go without [L] or use [R] instead.