WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Fatal error when loading homepage (6 posts)

  1. ledshaka
    Member
    Posted 6 years ago #

    I just went through the installation process fairly easily but wanted to change the Blog address (in the admin's "Options" menu) to my main domain name. I changed the index.php file and uploaded it but I'm getting this error message when I log in:

    Fatal error: Call to undefined function: get_header() in /homepages/6/d218508458/htdocs/index.php on line 1

    You can see for yourself at . I'm sure I've missed something simple but could really use a more seasoned hand. Thanks

  2. robmader
    Member
    Posted 6 years ago #

    What did you change in the index file? Can you post it?

    I don't think that you should have changed the index.php file, just used the options in WP.

    You can always just redirect from your domain root (yourdomain.com/) to the home of your blog using meta refresh or apache config.

    A quick fix might be to write over your index.php file with the original and try again.

    Rob

  3. ledshaka
    Member
    Posted 6 years ago #

    Rob, thanks for replying. Here's the substance of my index.php file:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./MitchellBlog/wp-blog-header.php');
    ?>

    Also, there's no .htaccess file in my version WordPress folder. Is that normal? These are likely ultra-mundane, low-level questions but I just learning here. Thanks again.

  4. robmader
    Member
    Posted 6 years ago #

    There is no .htaccess in the WordPress root by default.

    A quick workaround is to remove the index file that you created in your domain root and replace the original in the blog directory, then use the following index file to redirect to your blog (uploaded in your root):

    <HTML>
    <HEAD>
    <meta http-equiv="refresh" content="0;url=http://www.yourdomain.com/blog_address">
    </HEAD>
    <BODY>
    <p>connecting...</p>
    </BODY>
    </HTML>

    Rob

  5. ledshaka
    Member
    Posted 6 years ago #

    Rob, thanks for the help. As suspected the main problem was a user error, namely = I'm an idiot. The change that I made to the index.php file as per the WordPress guidelines was correct. I failed, however, to move the file to my root directory. I just kept uploading it to the same folder at my domain. So, all you fellow noobs out there with a similar error message, be sure you've actually moved the file to the root. It's a totally logical thing. You're trying to get the webpage loaded at the main domain name. Well, there needs to be some information to guide the browser, i.e., your index.php file.

    Again, I appreciate Rob's pitching in with what also would have worked.

  6. robmader
    Member
    Posted 6 years ago #

    I understand your pain! Often the simplest solution is to look at where the ftp is pointing...

    I've since introduced the way you've done the index to one of my sites - removing the html file workaround with the meta refresh.

    Thanks
    Rob

Topic Closed

This topic has been closed to new replies.

About this Topic