Giving WordPress its Own Directory While Leaving Your Blog in the Root Directory (25 posts)

  1. Giovanni Putignano
    Posted 9 years ago #

    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.

  2. Doodlebee
    Posted 9 years ago #

    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?

  3. Giovanni Putignano
    Posted 9 years ago #

    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/.

  4. Giovanni Putignano
    Posted 9 years ago #

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

  5. Doodlebee
    Posted 9 years ago #

    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:

    define('WP_USE_THEMES', true);

    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.

  6. yulias
    Posted 9 years ago #

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

  7. Giovanni Putignano
    Posted 9 years ago #

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

  8. Chris_K
    Posted 9 years ago #

    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

  9. Giovanni Putignano
    Posted 9 years ago #

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

  10. Giovanni Putignano
    Posted 9 years ago #

    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.

  11. Doodlebee
    Posted 9 years ago #

    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.

  12. Giovanni Putignano
    Posted 9 years ago #

    Many thanks.

  13. lesliekirk
    Posted 9 years ago #

    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:

    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.


  14. moshu
    Posted 9 years ago #

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

  15. PenMaster
    Posted 9 years ago #

    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?



    / (My Root Directory)

    .bashrc 0 k


    / public_html (My Word Press Directory) I think!

    Create New File
    .htaccess 0 k
    400.shtml 0 k
    401.shtml 0 k
    500.shtml 0 k
    error_log 0 k

    Pen Master

  16. MichaelH
    Posted 9 years ago #

    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:

    /* Short and sweet */
    define('WP_USE_THEMES', true);

    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:

    /* Short and sweet */
    define('WP_USE_THEMES', true);

    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.

  17. PenMaster
    Posted 9 years ago #

    Thank You MichaelH
    That helps I was pretty sure that was what I needed to do
    most of my confusion stems from not being familiar with the Cpanel interface.
    Thank Again
    Pen Master

  18. steinarknutsen
    Posted 9 years ago #

    Holy cow! This was fun - about an hour to get it right but MichaelH's tips worked best in the end. Thanks for your help!

  19. stompy
    Posted 9 years ago #

    How about this.

    I want wordpress installed in my root (mysite.com). But instead of my blog landing page I want a page that looks different to my blogs theme. I have tried the static page option but all this gives is my landing page inside the theme when I've pasted my html code for the static page.

    I don't want to create an index.html because this might cause some confusion with seo indexing both index.php and index.html

    Can i have wordpress installed in my root (mysite.com) and rename the wordpress file index.php to say index1.php so my landing page will be index.php or will this confuse wordpress?

    Do you know what the best option is for this situation?

    Thanks for anyone's help...


  20. moshu
    Posted 9 years ago #

    and rename the wordpress file index.php to say index1.php
    No, you can not!
    As it was stated above in this thread (by HandySolo) WP needs its index to be named index. Nothing else.

    Creating a Page template (see Pages) should solve your issue.

  21. kbbn
    Posted 8 years ago #

    I have worked at the instructions in Giving_WordPress_Its_Own_Directory referring to suggestions here. I eventually got it to the point where my Admin panel opens fine but when I click on "view site" I am directed to a login for my control panel.

    I had trouble following the instructions so that may be the problem.
    My difficulties included:
    #7 Copy the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).

    There are several index.php files (I know because I looked through most of the site for the .htaccess file) so I used the one from the main WordPress directory - I assume that is correct. The instructions say copy - does that mean a copy should remain in the WordPress directory?

    There was no .htaccess file in the WP directory so I uploaded one from another site and changed the site name info. But when I access the remote location from my FTP client it doesn't show in the list of files - maybe that's typical. It does show up inside my backup file on my desktop.

    Would either of these actions result in the above problem?

    I have read about "pointing a domain to a host" but don't know what that means or how to do it. If that's the problem could you please point me to some instructions. Thanks

  22. jrothra
    Posted 8 years ago #

    I followed the instructions found at http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory completely.

    Currently, my blog is in the /blog subdirectory, but I want to change the root index to be the blog root index. So, these instructions were perfect, or so I thought.

    After I changed them, I discovered something: the blog posts were not being pulled from the database, some of the CSS was not coming through correctly yet some was. I'm not sure what to do.

  23. jrothra
    Posted 8 years ago #

    I forgot to show what I mean.

    Here's how the blog index should look, and does look, in the subdirectory (www.domain.com/blog/):
    Correct version

    Here's how it looks when I have the core files in the subdirectory and use WP's main index as the domain's root index:
    Incorrect version

  24. alexanderrmorrow
    Posted 8 years ago #

    Please help me! I can't figure out how to have a separate wordpress folder while keeping my blog at my main domain.

  25. MichaelH
    Posted 8 years ago #


    Posting in multiple threads with the same question is discouraged.

    Please see: http://wordpress.org/support/topic/152713?replies=7

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.