View Full Version : Rewrite on sub domain.

02-03-2011, 01:38 PM
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:

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:

RewriteEngine on
RewriteBase /sub/
RewriteRule ^foo/bar/$ /bar/foo/ [NC,L]

but that does not work either.