Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    11
    Trophy Points:
    168
    Location:
    Finland
    cPanel Access Level:
    Root Administrator
    Check what is the error message in /usr/local/apache/logs/error_log
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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:
    16,352
    Likes Received:
    402
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. quietFinn

    quietFinn Well-Known Member

    Joined:
    Feb 4, 2006
    Messages:
    998
    Likes Received:
    11
    Trophy Points:
    168
    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");
    ?>
    
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  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

  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