How to Set up index.php in Root Folder (WordPress)

Discussion in 'PHP' started by webgaya, Nov 13, 2006.

  1. #1
    I have installed my blog on a sub directory
    in root directory called blog.

    The address to blog is like below,
    http://www.my-domain-name.com/blog/

    Now I want my root address refers to the
    blog. That means when someone types,
    http://www.my-domain-name.com/
    It should show my blog.

    Here I don't mean a redirection. I want
    to create an index.php in root folder
    and replace index.html with it.

    My blog's index.php contains following
    content.

    
    <?php get_header(); ?>
    <div class="content">
    <div class="primary">
    <?php include (TEMPLATEPATH . '/theloop.php'); ?>
    </div>
    <?php get_sidebar(); ?>
    </div>
    <?php get_footer(); ?>
    
    PHP:
    I can't figure out how to call functions like
    get_header() in my custom made index.php
    which is in root folder.

    Can anyone help me to get this done? :confused:

    webgaya.
     
    webgaya, Nov 13, 2006 IP
  2. maiahost

    maiahost Guest

    Messages:
    664
    Likes Received:
    35
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Why don't you simply install the blog in your root folder instead of trying to do it with the index.php. Wordpress is likely to give some errors if the only file in the root folder is the index.
     
    maiahost, Nov 13, 2006 IP
  3. Richie_Ni

    Richie_Ni Illustrious Member

    Messages:
    10,721
    Likes Received:
    1,175
    Best Answers:
    0
    Trophy Points:
    410
    #3
    Use .htaccess to redirect .Do a search on google if you don't know how to do.
     
    Richie_Ni, Nov 14, 2006 IP
  4. webgaya

    webgaya Active Member

    Messages:
    132
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #4
    webgaya, Nov 14, 2006 IP