domain name routing and htaccess

Discussion in 'Server Operation' started by KenKnight, Jan 25, 2007.

  1. KenKnight

    KenKnight Member

    Hi all,

    I have question regarding the routing of domain names that are pointed to a virtual server.

    Let's say I've got MyDomainA.com pointed to a virtual server along with MyDomainB.com pointed to the same virtual server. Is it possible to MyDomainB.com to redirect to a folder on that server (ie MyDomainB.com/domainb/ )?

    Maybe using an htaccess file or something?

    I don't have access to the Vhosts file for this server, thats why I'm trying to find alternative methods.

    Thanks,
    Ken
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. KenKnight

    KenKnight Member

    Thanks,

    I've used php for header / location redirects for a long time, but didn't even think about just writing a main index.php with the header code to redirect based on $_SERVER["HOST"] variable.

    Works like a champ.

    Cheers!
    Ken
     

Share This Page