.htaccess Help...Can't Figure This Out

crazyflx

Elite Member
Joined
Nov 9, 2009
Messages
1,623
Reaction score
4,870
Alright, I tried searching google, and while I found a lot of answers that were ALMOST what I needed, nothing quite does EXACTLY what I need. Hopefully somebody here can help me out.

I have a site that I just copied completely to a brand new domain...but in a sub-directory.

I need a .htaccess code that can do this:

Take http://oldsite.com/page1.htm and turn it into:

http://newsite.com/newdirectory/page1.htm

It has to be able to do that for ALL the pages of http://oldsite.com/ automatically.

Any suggestions?
 
Alright, I got it figured out, I was over-complicating things.

Code:
Options +FollowSymLinks 
RewriteEngine on 
RewriteCond %{HTTP_HOST} ^olddomain.com [NC] 
RewriteRule ^(.*)$ http://newdomain.com/newdirectory/$1 [L,R=301]
 
Back
Top