WordPress.org

Support

Support » How-To and Troubleshooting » Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory

Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory

  • I’ve installed my blog in another directory and I’ve also renamed index.php to blog.php.
    In this way wordpress consider the file blog.php as a directory, this should be improved to let users both move the blog and rename this file.

Viewing 15 replies - 1 through 15 (of 24 total)
  • I don’t understand what you’re saying?

    If wordpress is in it’s own folder, and you want your index page to show at the root, you just move the “index.php” file into your root directory and call in the header for the files. It’s pretty simple.

    I’m not sure what issue you are having?

    If I move the index.php file OK, but if I rename index.php to blog.php doesn’t work right because blog.php become a directory so wordpress search for blog.php/index.php file. In fact when I try to rebuild permalink wordpress search for htaccess file in the directory called blog.php/.

    Are you there? Can I post this as a bug?

    I’m here *now* – I don’t live here.

    I still don’t understand your issue. (I definitely don’t understand why you’re renaming your index.php file “blog.php”).

    No, I wouldn’t say this is a bug. It seems more like something’s not clicking right for you because maybe you don’t understand whatever it is you’re trying to do.

    The *only* time I’ve ever heard of renaming “index.php” to “blog.php” is when you have your WordPress installation in the root of your site, but you want it to *look* like it’s in a subdirectory.

    You’re stating that you already have WordPress in a subdirectory, but you want it to appear as if it’s in the root of your server. You’re following directions for the opposite of what you’re trying to do.

    If WordPress is in a subdirectory, then create an index.php file – with Notepad – and put this in it:

    <?php
    define('WP_USE_THEMES', true);
    require('./cms/wp-blog-header.php');
    ?>

    The “./cms/” part has to point to the directory that WordPress is in. Upload the file to your root server. That’s it. No renaming of files – nothing else – just that.

    Or you can replace index.php to index.html and feel the new blog layout, try it 🙂

    I renamed it because in the same directory I have already a file called index.php

    Then it’ll probably never work.

    Rename the old index.php. WP needs it’s own index.php to be named (cleverly enough) index.php.

    More: Giving_WordPress_Its_Own_Directory

    Ok, it could be better if I could rename the index.php file.

    I better explain. I’ve integrated osCommerce and WordPress so I have in the same directory both osCommerce installation and wordpress installation. I renamed index.php to blog.php to not override index.php file of osComemrce installation.
    See here.

    Ahhh…there it is Handy – I couldn’t find that link!

    I better explain.

    LOL…how many posts later, and now you want to explain? That’s funny.

    Okay. So you want wordpress to show up in the directory of “/blog”?

    Then just put it there. You don’t need to go all through this just to have wordpress in the /blog directory. Create a directory, name it /blog and move all of your WordPress to that directory. (And no – don’t just move the files – you actually have to do some tweaking to move the actual installation so it doesn’t break.)

    If you haven’t created any posts or anything yet, and this is a new installation that you’re trying to get configured, then the easiest method would be to just delete what you’ve got, clear your database tables, and create the /blog folder in your directory tree. Upload all of your wordpress files into the /blog directory. Install it. Then your blog will be in /blog.

    Hopefully, that’s what you’re trying to do – that’s what I’m gathering from your stuff here.

    Many thanks.

    I have followed the instructions out line here http://codex.wordpress.org/Moving_WordPress to a T (more than once) to move my entire installation from the root to a sub-directory. My admin works but the blog itself isn’t – the page only partially loads. I even tried uploading “fresh” files thinking something may have been corrupted.

    I’m at a loss as to what to check. The broken site is here:
    http://www.ignatiusproductions.org/frmitch/

    Unfortunately, I’m on a deadline so I may have to revert back to the old root location – but I’ll try to leave everything “as is” for a little while.

    Thanks,
    Leslie

    Did you move it or you want to “give WP its own directory“?
    Those are two [2] different things!

    Hello All
    I’m just getting started and I have my blog working ok but I put it up on a host that uses Cpanel which I am not familiar with. I have the ability to add more domains and so I pointed one of my other domains at the new host. AN_Hosting while looking at the file structure some questions occured to me that I can’t find the answers for. I came across this thread and have read it three times today but I can’t make sense of it. I don’t think I have the expertise to go with WPMU and only want a few blogs on this server. I want to be able to keep domains seperate and easy to maintain. The documentation uses a /wordpress
    directory in the path but on my server I don’t have that directory I want these blogs independent and portable.

    Does it make sense to put each blog in it’s own directory with it’s own installation of Word Press?

    Is the /public_html directory my Word Press directory
    given the file structure below?

    FILE LISTING ON THE SERVER

    ================================================

    / (My Root Directory)

    .cpaddons
    .cpanel-datastore
    .entropybanner
    .fantasticodata
    .htpasswds
    .sqmaildata
    .trash
    betsys_html
    etc
    mail
    pen_html
    public_ftp
    public_html
    tmp
    www
    .bash_logout
    .bash_profile
    .bashrc 0 k
    .contactemail
    .gtkrc
    .lastlogin
    .spamkey
    5.rtf
    backup-6.28.2007_15-00-59_meaXXXXX.tar.gz
    google944aeffd588def2d.html

    ===============================================

    / public_html (My Word Press Directory) I think!

    cgi-bin
    entropybanner
    wp-admin
    wp-content
    wp-includes
    Create New File
    .htaccess 0 k
    400.shtml 0 k
    401.shtml 0 k
    500.shtml 0 k
    error_log 0 k
    fantastico_fileslist.txt
    fantversion.php
    google922aBfHd588def2d.html
    index.php
    license.txt
    readme.html
    sitemap.xml
    sitemap.xml.gz
    wp-app.php
    wp-atom.php
    wp-blog-header.php
    wp-comments-post.php
    wp-commentsrss2.php
    wp-config.php
    wp-cron.php
    wp-feed.php
    wp-links-opml.php
    wp-login.php
    wp-mail.php
    wp-pass.php
    wp-rdf.php
    wp-register.php
    wp-rss.php
    wp-rss2.php
    wp-settings.php
    wp-trackback.php
    xmlrpc.php
    ==============================================

    TIA
    Pen Master

    Typically in a cPanel host, you have a ‘main domain’. The web-root folder for that domain is /public_html. If you are installing WordPress for that main domain then consider putting WordPress in a folder called /public_html/wordpress (so you would have /public_html/wordpress/wp-content and so on. In addition you would have a file called /public_html/index.php with this content:

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

    The example above is what is explained in Giving_WordPress_Its_Own_Directory.

    For other domains, let’s say one is called domain1.com, then when you create an Add-on domain (see cPanel help for this), you will point that domain to a folder in public_html that will be considered that domain’s web-root folder. So you would have a folder called public_html/domain1. Then you would install WordPress in that folder for domain1.com. You could install WordPress and use the information from Giving_WordPress_Its_Own_Directory. So you would have a folder /public_html/domain1/wordpress and a file called /public_html/domain1/index.php with this content:

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

    It is easy to use the File Manager in cPanel to do this. First navigate to the public_html folder, upload the WordPress zip distribution file, then use the Extract File Contents link (on the right) and it will extract wordpress into /public_html/wordpress. For that other domain, navigate to /public_html/domain1, upload the WordPress zip distribution file, and again Extract File Contents and you will have the WordPress folders/files in /public_html/domain1/wordpress.

Viewing 15 replies - 1 through 15 (of 24 total)
  • The topic ‘Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory’ is closed to new replies.