The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Header Redirects on "Parked"Domains

Discussion in 'General Discussion' started by tj111, Sep 12, 2007.

  1. tj111

    tj111 Member

    Joined:
    Sep 7, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I am moving several (small) corporate websites over from an iPower VPS (terrible host btw) to LiquidWeb, which means I'm learning all the nuances in the new CP (WHM, cPanel). Now one company has three domain names (with employee only sections), all pointing to the same website (alias/parked domains). In Plesk, if I set them up as Alias domains, going to domain.com or domain.net pointed to the same website, but maintained the domain URL in the address bar indefinitely. Now on the new host, I have them set up as parked domains in cPanel (I thought this was the equivilant to alias). If a user goes to domain.net and follows a link on the page, they are taking to domain.net/link, as it should be.

    However when an employee attempts to login at domain.net/login, the form action points to the login script, which in turn uses a PHP Header redirect to take them to the home page (or whichever page they attempted to access when not logged in). But when the header redirects them, it redirects to the domain.com logged in home page, and as the domain has changed it fails the session validation script, so they get redirected to domain.com/login, saying they are not logged in.

    I put a note on the login page explaining you may have to login twice for now, but as you know some people just can't understand the interwebz, so I'm still getting lots of emails and phone calls about people not being able to login. Anyway, long story short, where should I start about fixing this problem? I haven't a clue about how WHM/cPanel manages parked domains and how it configures them, so I'm lost about where I should start looking.
     
  2. tj111

    tj111 Member

    Joined:
    Sep 7, 2007
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    1
    I think the issue is rooted from the status codes sent in the headers. After doing some testing on it, here's what happening. Here is an overview of the header information and what I think is causing the problem. (Notice the TLD change).

    Action/Referring Page: page location -> http status

    user goes to domain.net
    : domain.net ->200 OK

    user clicks employee login: domain.net/login.php -> 200 OK

    user enters info and clicks login: domain.net/go/checklogin.php -> 304 found

    domain.net/go/checklogin.php redirects:
    domain.net/home -> 301 Moved Permanently

    domain.net/home redirects: domain.com/home -> 200 Ok

    From there they fail the validation on said page and get redirected back to the domain.com/login.php page. The problem is the 301 moved status on the subdirectory, how can I change this so it gives me a 200 OK, like all the pages in the home directory? I have a basic knowledge of .htaccess and httpd.conf, I just want some guidance on where to start and what to do, others I'll probably just screw it up more.
     
Loading...

Share This Page