I've been trying to use .htaccess to redirect files from /sub-directory/directory to /directory and I can't seem to find the right variation. This is the code I'm trying RewriteCond %{REQUEST_URI} !^/sub-directory/directory/.*$ RewriteRule ^(.*)$ /directory/$1 [R=301,L] PHP: Thank you for any help.
I'm actually trying to move domain.com/sub-directory/directory/file.html to domain.com/sub-directory/file.html (remove /directory from url) thanks in advance
I found a working solution to my boggle, this works for what i needed. RewriteRule ^sub-directory/directory/?(.*) http://www.domain.wee/directory/$1 [R=301,L]