automatically rewrite url

MastermindNL

Newbie
Joined
May 22, 2009
Messages
15
Reaction score
5
Hello guys,

I have searched for this and couldn't find anything on blackhatworld/google.

I want to automatically change the url.

When you enter:
http://www.mydomain.com/page1/variable

you need to go to:
http://www.second-domain.com/page1/variable

I know i can hard code it at the first location. But I would like to know if I can make a function for it or if it's possible to do with htaccess. I don't feel like hardcoding hundreds of pages. Maybe something like of "www.mydomain.com/page1" os in the url change it to "www.second-domain.com/page1/"

A link to a tutorial or website that explains it will be enough :)
 
Modrewrite should do it, i've really only done that with internal url rewriting though.

http://corz.org/serv/tricks/htaccess2.php
 
Back
Top