I have a sub domain sub.domain.com and i wanted to rewrite anything that was looking to a certain path on the domain say sub.domain.com/foo/bar/file.php and I wanted to rewrite it as sub.domain.com/bar/foo/file.php

My question is would I make a new htaccess file on the sub domain and then write in it:
Code:
RewriteEngine on
RewriteBase /
RewriteRule ^foo/bar/$ /bar/foo/ [NC,L]
When I have tried this it does not find the page I am looking for. I have also tried to specify the path in the main htaccess file like:
Code:
RewriteEngine on
RewriteBase /sub/
RewriteRule ^foo/bar/$ /bar/foo/ [NC,L]
but that does not work either.

Thanks.