Forums

[resolved] Moving WordPress to the root directory (3 posts)

  1. Palmersgreen
    Member
    Posted 10 months ago #

    I'm quite new at this. I have always understood that there are no stupid questions, just easy answers. I have just installed WordPress and accepted the default location, which was in a subdirectory. This means that anyone coming to my site sees a directory listing rather than the site itself. Can I simply move the entire installation to the root directory, or do I have to delete it and start again? Or is there an easy way to get WordPress to come up automatically when someone visits my site?

    Thanks for any help you can give.

  2. MichaelH
    Volunteer
    Posted 10 months ago #

    If you have created any content (posts etc) it might be easier to just reinstall. Or you could move it (see Moving WordPress).

    Or you could use this trick:
    Assuming you installed in a folder called blog, to make WordPress available at http://mydomain.com in Settings->General, change the Site address (URL) to http://mydomain.com and put this index.php file in your web-root folder (it is the same folder that contains the blog folder)

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./blog/wp-blog-header.php');
    ?>
  3. Palmersgreen
    Member
    Posted 10 months ago #

    Thanks. In the end I simply moved the entire installation to the root directory, and it works just as it should.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.