1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

.htaccess settings w/ Parked Domains

Discussion in 'Software Development' started by mussavcom, Apr 27, 2004.

Thread Status:
Not open for further replies.
Advertisement
  1. mussavcom

    mussavcom Thread Starter

    Joined:
    Mar 28, 2004
    Messages:
    51
    Could I modify the .htaccess in my shared hosted server's public_html (also known as www) folder to redirect if people come in through a parked domain?

    Basically... if they go to primarydomain.com, it will load primarydomain.com/index.html. But if they access my site through parkeddomain.com, instead of loading primarydomain.com/index.html like it normally would, they would be redirected to primarydomain.com/folder/index.html.

    Is there anything I can do to achieve this in .htaccess? If not, what about in a PHP file (can it tell if it's being accessed by primarydomain.com or parkeddomain.com)?
     
  2. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    That depends exactly what your host lets you do with a parked domain. You may be able to forward it to another site (check with your domain registrar and host on this).

    If your parked domain can have a custom index page, you could just use that to forward to primarydomain.com/folder/index.html

    Worst comes to worse and your host doesn't let you do ANYTHING with a parked domain, you could have primarydomain.com/index.html check where the user came from. If they came from parkeddomain.com, forward them.
     
  3. mussavcom

    mussavcom Thread Starter

    Joined:
    Mar 28, 2004
    Messages:
    51
    That's my question: how do I check where they came from? Does $_SERVER['HTTP_REFERER'] (PHP) say if they came from parkeddomain.com?
     
  4. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    Yes, most of the time it will.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/224452

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice