WordPress installation site folder move to the final site destination

My client have a site : business.com

All the files of the old fashion site is there, images, video, html, css. i just made a folder called business.com/cms and installed wordpress here. FOr 2 month they write stuff, upload images and do there site in wp. Now it’s time to lunch the site

Read More

The problem, all the images and page belong to business.com/cms not the root business.com. when i will remove the old site and put all the file from the cms folder at the root level, the site will miss a lot of thing, images and manually link pdf in text

How do you do that properly. Is itst possible to keep the site in /cms and used some .htaccess wizardry to make it look like root ?

HELP, need to lunch tomorrow !

Related posts

Leave a Reply

3 comments

  1. Your easiest solution here is to keep everything in your cms folder.

    and follow this step found at
    http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

    This will keep all wordpress related files in the cms folder, but it will look like its running from the root, copy of index and some .htaccess wizardly as you call it :).
    enjoy

    Using a pre-existing subdirectory install

    If you
    already have WordPress installed in its own folder (i.e.
    http://example.com/wordpress) then the steps are as follows:

  2. Go to the Generalpanel.
  3. In the box for Site
    address (URL):
    change the address to the root directory’s URL.
    Example: http://example.com
  4. Click Save
    Changes
    . (Do not worry about the error message and do not try to
    see your blog at this point! You will probably get a message about
    file not found.)
  5. 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. If you are running WordPress on
    a Windows (IIS) server
    and are using pretty permalinks, you’ll
    have a web.config rather than a .htaccess file in
    your WordPress directory. As stated above, copy (don’t move) the
    index.php file to your root directory, but MOVE (DON’T COPY)
    the web.config file to your root directory.
  6. Open your root directory’s index.php file in a text editor
  7. 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’);
  8. Login to your site. It should still be
    http://example.com/wordpress/wp-admin/
  9. 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.)
  10. In Settings > General change WordPress Address (URL) to http://business.com/cms and Site Address (URL) to http://business.com.

    The index.php file in root (not in cms/ directory)

    <?php
    /**
     * Front to the WordPress application. This file doesn't do anything, but loads
     * wp-blog-header.php which does and tells WordPress to load the theme.
     *
     * @package WordPress
     */
    
    /**
     * Tells WordPress to load the WordPress theme and output it.
     *
     * @var bool
     */
    define('WP_USE_THEMES', true);
    
    /** Loads the WordPress Environment and Template */
    require('./cms/wp-blog-header.php');
    

    Then move cms/config.php in the root to config.php.
    And also move .htaccess from cms/ directory to root.

    Find the following lines if exist

    RewriteBase /cms/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /cms/index.php [L]
    

    and remove cms/ string so you end up with the following

    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    

    Let me know if something went wrong.

  11. Wait…is it just me or no one thought suggesting a find & replace in the database might have fixed his problem..??

    Find business.com/cms/ & replace it with “/” or “business.com”

    And obviously moving the files from subfolder cms to the public_html…

    All could have been done via ssh in seconds…