Help with redirect

Discussion in 'Site & Server Administration' started by ciolanit, Sep 22, 2009.

  1. #1
    Hy,
    I have an godaddy account for hosting and on that host i have multiple domains and godaddy offers me only one 404 redirect for all of my domains,
    ( example2.com/gadf is redirected to example1.com and example3.com/sagsdg is redirected to example1.com ) and i need for one of my domains to make the redirect on the same domain an for the subdomain for the same domaine to be redirected to the same subdomain or at least the domain ( example4.com/gsdhgfhf to be redirected to example4.com and example4.com/blog/gdfgsd to be redirected to example4.com/blog or to example4.com )
    I really hope you understand what i meant and that you can help me.
     
    ciolanit, Sep 22, 2009 IP
  2. SecureCP

    SecureCP Guest

    Messages:
    226
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Have you considered a meta redirect?
     
    SecureCP, Sep 22, 2009 IP
  3. ciolanit

    ciolanit Peon

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How?
    The only meta redirect that i know applies for a visitor to a domain to be redirected to another domain
     
    ciolanit, Sep 22, 2009 IP
  4. adbox

    adbox Well-Known Member

    Messages:
    906
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    155
    Digital Goods:
    1
    #4
    php redirect

    <?php

    header("Location: http://www.thedomain.com");
    ?>
     
    adbox, Sep 22, 2009 IP
  5. ciolanit

    ciolanit Peon

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    my redirect from the goddady host send all 404 errors to my first domain,
    will these work?
    don't i need to do something in the htacces ?
     
    ciolanit, Sep 23, 2009 IP
  6. zacharooni

    zacharooni Well-Known Member

    Messages:
    346
    Likes Received:
    20
    Best Answers:
    4
    Trophy Points:
    120
    #6
    PHP redirects work by sending the header() call directly to the client, but additionally, you may want to do this.

    
    <?PHP
    $url = "http://www.newsite.com/";
    die(header($url, 301));
    ?>
    
    Code (markup):
     
    zacharooni, Sep 24, 2009 IP
  7. ciolanit

    ciolanit Peon

    Messages:
    116
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    added this code on the domain but if i try the 404 error i am still sent to my first domain not back to the domain i tried the 404 error.
     
    ciolanit, Sep 24, 2009 IP