Results 1 to 1 of 1
Thread: Multiple domain redirect
Nov 29, 2006, 09:15 #1
- Join Date
- Nov 2006
- 0 Post(s)
- 0 Thread(s)
Multiple domain redirect
I've a domain working on Apache/2.0.59 (Win32) mod_jk/1.2.18 PHP/4.4.4 setup. It works fine, but I recently configured another domain on the same server. Nameservers and everything is fine but the new domain points to the location of old domain.
Is there any way, using PHP, to redirect both domains to different locations?
For a single domain redirect, I used this so far:
<?php header("Location: v/index.jsp"); /* Redirect browser */ /* Make sure that code below does not get executed when we redirect. */ exit; ?>
I tried this for multiple domain redirect, but it doesn't work:
<?php header("Location: http://domain1.com" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/dir/file.ext" . $relative_url); header("Location: http://domain2.com" . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/dir/file.ext" . $relative_url); ?>
Any help greatly appreciated.