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.

index.php will not redirect to new directory due to server error

Discussion in 'General Discussion' started by sounay, May 9, 2013.

  1. sounay

    sounay Registered

    Joined:
    May 9, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi all,

    I'm experiencing server error with my index.php. It will not respond.
    The is the result when access domain.com
    dddd.jpg

    The problem is that the index.php will not automatically redirect to domain.com/home
    What is the issue behind this? What kind of mod or features of apache is missing?

    please kindly help me, appreciated.

    The index.php script is as follows:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- <meta http-equiv="Refresh" content="0; url=http://www.domain.com/home">-->
    <title>title here</title>
    <link rel="icon" href="http://domain.com/favicon.ico">
    <link rel="image_src" href="http://domain.com/vh_logo.jpg" />
    </head>
    <body>
    <?php
    $host  = $_SERVER['HTTP_HOST'];
    $uri   = "/home";
    $extra = '';
    header("Location: http://$host$uri/$extra");
    exit;
    ?>
    </body>
    </html>
    
    regards,
    Sounay
     
    #1 sounay, May 9, 2013
    Last edited by a moderator: May 9, 2013
  2. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Check what is the error message in /usr/local/apache/logs/error_log
     
  3. sounay

    sounay Registered

    Joined:
    May 9, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, this what I found in error_log file
    regards,
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
  5. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    10
    Trophy Points:
    18
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    It should work like this:

    Code:
    <?php
    $host  = $_SERVER['HTTP_HOST'];
    $uri   = "/home";
    $extra = '';
    header("Location: http://$host$uri/$extra");
    ?>
    
     
  6. sounay

    sounay Registered

    Joined:
    May 9, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
  7. sounay

    sounay Registered

    Joined:
    May 9, 2013
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi, it did not work. I tried it many times with refreshing the browser.

    Regards
     
Loading...

Share This Page