Thread: htaccess q.
View Single Post
Old 06-19-2013, 03:35 AM  
paffie
Confirmed User
 
Industry Role:
Join Date: Mar 2013
Posts: 116
i did something like this before on one of my blogs... but i cannot seem to find the htaccess file i used back then...

I suppose it's basically (got this from stackoverflow):
//begin code
RewriteCond %{REQUEST_URI} !^v2/
RewriteRule ^(.*)$ v2/$1 [L]
//end code

Basically, you have a condition when to rewrite, in this case: the url cannot end with v2/
In case the uri doesn't end with v2/, everything after the domain will be rewritten to the v2-directory...

in your case, it will be something like
//begin code
RewriteCond %{REQUEST_URI} ^firstdirectory/
RewriteRule ^(.*)$ seconddirectory/$1 [L]
//end code

I'm not an htaccess guru, try it out for yourself, and see if it works ;-)
paffie is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote