I have two different domains pointed at my web site and I would like to redirect visitors according to which domain they are trying to access. I've already set up a separate directory within my document directory so that I can keep the files separate.
I feel kind of stupid because I don't even know what to look for. I've tried searching on redirection but have so far come up blank. I'm sure it doesn't need to be any more than a couple of lines of code. I know how to do this with ASP, but not PHP.
Redirection according to URL?
Moderator: General Moderators
try looking on php.net on the header() command...
header("Location: http://www.somewhere.com/somewhere.php");
NOTE: You MUST NOT output anything (echo, print, or even errors), because it won't work then!
Was that what you wanted?
header("Location: http://www.somewhere.com/somewhere.php");
NOTE: You MUST NOT output anything (echo, print, or even errors), because it won't work then!
Was that what you wanted?