WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Help on Giving WordPress its own directory (10 posts)

  1. Dan
    Member
    Posted 10 months ago #

    Hello pals,

    I got a website at BlueHost and my WP was installed with the help of MojoMarket.

    I tried to apply the instructions on this http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    But I couldn't make sense of it.

    1/ "Create the new location for the core WordPress files to be stored".

    Where is that?

    2/ "In the box for Site address (URL): change the address to the root directory's URL. Example: http://example.com"

    Isn't http://example.com already the default on that space?

    3/"Move your WordPress core files to the new location (WordPress address)."

    I don't have a folder with that specific name or stuff.

    I appreciate if you could suggest a more elaborate text or video guide.

    Thank you in advance for your help.

  2. sloyer
    Member
    Posted 10 months ago #

    1. In your main directory, you need to create a new folder for you wordpress files to be installed in. Example: Create a new folder called "wordpress"

    2. Your new directory for wordpress would be http://yoursite.com/wordpress

    3. Take all files from your original WP install and place them into the wordpress folder

    This step is very important.. - Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). The .htaccess file is invisible, so you may have to set your FTP client to show hidden files. If you are not using pretty permalinks, then you may not have a .htaccess file.

    Then follow these steps out -
    Open your root directory's index.php file in a text editor
    Change the following and save the file. Change the line that says:
    require('./wp-blog-header.php');
    to the following, using your directory name for the WordPress core files:
    require('./wordpress/wp-blog-header.php');
    Login to the new location. It might now be http://example.com/wordpress/wp-admin/
    If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can't write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)

  3. Dan
    Member
    Posted 10 months ago #

    Thank you Sloyer for your fast reply.
    I appreciate it.

    Let me pose follow-up questions (if I should get those from my web-host, tell me so)

    1/ Where is my "main directory"? All I know is, MySql, databases, ftp files. Unless you are referring to the php files?

    3/Is there a single location where my WP installs are stored?

    *Last I checked (during my previous trials/exercises with WP), I got access to .htaccess file. In fact, my host told me I got full control.

    Thanx again.

  4. leejosepho
    Member
    Posted 10 months ago #

    Stop!

    This step is very important.. - Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address).

    Not at BlueHost. Take a look at this and call a Support Tech:
    https://my.bluehost.com/cgi/help/347#redirect

    When I moved mine, the Support Tech did a drag-and-drop to my new folder, then I dropped the new ,htaccess into place and we both headed to the coffee pot. Nothing more is required there.

  5. Dan
    Member
    Posted 10 months ago #

    @leejosepho

    You meant I should stop at step:3, then follow your link?

  6. leejosepho
    Member
    Posted 10 months ago #

    It would be best for you to call a BlueHost Support Tech rather than getting second-hand advice from me. But what I am saying is that I did not have to do any of what I call "that tricky stuff" while moving my BlueHost primary domain into a sub-folder. In my own experience, you only need to do these four things:

    1. Inside public_html and while using any name of your own choosing, make the new destination sub-folder for your primary WordPress installation;
    2. Locally prepare and hold the special .htaccess file -- https://my.bluehost.com/cgi/help/347#redirect -- that will soon replace whatever .htaccess is currently in public_html;
    3. Move (or ask a Support Tech to move, as I did) your primary WordPress installation into your new sub-folder;
    4. Upload the new .htaccess file into public_html and then go get a fresh cop of coffee so you are ready for moving along to whatever else you might have had in mind for the day.

    note: I did *not* have to do *any* of this...
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory
    ...even though it is mentioned here:
    https://my.bluehost.com/cgi/help/347#wordpress
    Also, not every Support Tech at BlueHost might know and understand why or why not about that any more than I do. Some of them are WordPress users and some are not, and the one I spoke with that day knew nothing either way about whether I had to do anything "tricky". So, we just did what we did and then quickly discovered we could head for the coffee pot while having no further concern related to having just moved and re-pointed my primary domain.

  7. Dan
    Member
    Posted 10 months ago #

    Thank you very much.

    One last question - a related one:
    Can you suggest me a good material on the pros and cons of running WP from a sub-directory? I found two, but they are brief and do not look authoritative.

    Thank you.

  8. leejosepho
    Member
    Posted 10 months ago #

    Can you suggest me a good material on the pros and cons of running WP from a sub-directory?

    Maybe take a look at Ipstenu-DH's posts here:
    http://wordpress.org/support/topic/installation-of-wordpress-different-directory-for-security?replies=12
    In my own case, and as a neatnick, I moved my primary domain into its own sub-folder simply to make things more organized -- each site in its own exclusive folder -- while working on things via FTP rather than continuing to risk confusing (or forgetting where I was and ending up in the wrong) wp-content (or whichever) folder when I had thought I was (or had meant to be) in another.

  9. Dan
    Member
    Posted 9 months ago #

    Thank you very much.

  10. nancywirtz
    Member
    Posted 2 months ago #

    Hi, I've done this before with other sites with the same host but it's been a while. I think this is where I'm getting stuck.
    Change the line that says:
    require( dirname( __FILE__ ) . '/wp-blog-header.php' );
    to the following, using your directory name for the WordPress core files:
    require( dirname( __FILE__ ) . '/wordpress/wp-blog-header.php' );

    My installed into the subdirectory /wordpress/ initially using my host's EasyApps. I want WP to power my root http://five-talents.com
    Am I supposed to change dirname to something? do I change something else?
    I can't get anything but an 'under construction' page for my URL...very frustrating :-(

Reply

You must log in to post.

About this Topic