Help With What SHOULD Be a Simple Redirect

by rbf738
2 replies
  • WEB DESIGN
  • |
Basically I want to redirect from a subdomain of one domain of mine to the top level of a completely different domain of mine. I've never been able to get the code right for some reason, could someone help me out with this?

So basically www.examplesite#1.com/subdomain

to

www.examplesite#2.info

Yes one's a .com and the other is a .info, don't know if that has anything to do with anything but if someone could spell it out how to do the redirect for me I'd appreciate it.
#redirect #simple
  • Profile picture of the author BobJutsu
    that is a subdirectory, not a subdomain...but that is beside the point.

    so, the page at www.examplesite#1.com/subdomain, create a php file index.php, or whatever you are using to access it.

    In that file put:

    <?php
    header("Location: http://www.examplesite#2.info");
    ?>


    And nothing else...no html tags, nothing. If you want it moved permanently, you can add the 301 header:

    <?php
    header
    ("HTTP/1.1 301 Moved Permanently");
    header("Location: http://www.examplesite#2.info");
    ?>
    {{ DiscussionBoard.errors[2366597].message }}
  • Profile picture of the author rbf738
    Ha sorry about that brainfart with the subdomain vs. directory, thanks for calling me out. Done and done, thanks man.
    {{ DiscussionBoard.errors[2366665].message }}

Trending Topics