Forum Moderators: coopster

Message Too Old, No Replies

Redirect to any page

How to redirect browser from old domain to new for any page accessed

         

Mermaiden

10:15 pm on Mar 3, 2006 (gmt 0)

10+ Year Member



I would like to know if there's a way to set up a redirect to send a person directly to the new URL, not just redirect to a static URL (the new homepage).... this might make more sense with an example.

If a person visits [oldurl.com...]
or page2.php or page3.php, etc etc

I want it to go to [newurl.com...]
or page2.php or page3.php, etc etc

I want it to dynamically parse the page trying to be accessed into the new URL.

As it stands, all I could do was set up a custom 404 page that redirects to [newurl.com...]

Any suggestions? :)

If I had to write some kind of array listing every URL to replace, I wouldn't mind. There aren't that many pages, but I didn't think that sounded very efficient. I'm mostly just doing this to try and learn.

coopster

1:26 am on Mar 4, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, Mermaiden.

Well, you certainly could script this in PHP but I'm thinking you may want to do this at the server level using Apache redirection [httpd.apache.org].

Mermaiden

6:30 pm on Mar 4, 2006 (gmt 0)

10+ Year Member



Oh! Thank you. That makes much more sense, and of course worked just perfectly. *blush*