Page 1 of 1

URL redirection script? or ???

Posted: Sat Jun 12, 2004 5:50 am
by justjoe
I hope I am posting in the appropriate forum. If not, please correct me.

I run a small hosting business using an EV!Servers box (Linux, Red Hat, Ensim CP).

A client owns two domain names. Let's call them:

sampleONE.com
sampleTWO.com

The client wants vistors who call for sampleONE.com to be directed to the web site at sampleTWO.com. An important element is that this should be done transparently, with minimal delay and the browser URL field should show the URL as sampleTWO.com.

I suspect this could be with a PHP script installed on the index page of sampleONE.com and I'm hoping someone can suggest one.

Advice please?

Posted: Sat Jun 12, 2004 6:20 am
by patrikG
See php-manual, examples for [php_man]header[/php_man].

Posted: Sat Jun 12, 2004 7:12 am
by justjoe
Thank you for your response.

I just went throiugh the entire section of the PHP Manual on Headers, every last word. I did not find anything there that seemed to address my question. If it did, it's couched in terms of some other issue that does not appear, to me, to be relevant.

Does anyone else have any other suggestions?

And, to the moderator, please do not mark the question solved. It may be for you but it's not for me and I think that's the point of a forum.

Posted: Sat Jun 12, 2004 7:20 am
by patrikG

Code: Select all

header("Location: http://www.php.net/header");
Exampe 4 in the php manual's chapter on header. You could also search this forum for "redirect".

P.S.: Moved to PHP Code

Posted: Sat Jun 12, 2004 12:08 pm
by Weirdan
It could be done with mod_rewrite:

Code: Select all

RewriteEngine On
RewriteRule ^/(.+) http://sampleTWO.com/$1 їR,L]

Posted: Sat Jun 12, 2004 4:49 pm
by patrikG
Sorry, my mind was too set on PHP. Thanks, Weirdan.