Seattle Web Design
Blog > WordPress Installed in SubDirectory

Meet the author:
Jill Olkoski

Jill has a MA in Clinical Psychology, a BS in Computer Science, and a BS in Mechanical Engineering.

She currently owns Aldebaran Web Design in Edmonds (near Seattle WA) and enjoys educating her clients on topics related to small business website design.

In Jill's previous life, she spent 17 years in the engineering and quality organizations of a Fortune 100 tech company.

 


WordPress Installed in SubDirectory

August 23rd, 2015

Sometimes you install WordPress in subdirectory, as in when you are converting a person with a pre-existing website to a WordPress website. Generally to keep things clean, you install WordPress in a subdirectory, and then move the content into WordPress. When you’re finished, you now need to “launch” the new website, but have it appear that WordPress was installed into the root directory.

So if for example you installed WordPress into:

http://somewebsite.com/whatever/

you now want it to look as if it’s installed

http://somewebsite.com

Here’s a link to the answer:

https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

And just in case that disappears, here are instructions (NOTE you need FTP access to your website to complete this process):

———-

Using a pre-existing subdirectory install

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

  1. Go to the General panel.
  2. In the box for Site address (URL): change the address to the root directory’s URL. Example: http://example.com
  3. 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.)
  4. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress (wordpress in our example) directory into the root directory of your site – the latter is probably named something like www or public_html. 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.
  5. Edit your root directory’s index.php.
    1. Open your root directory’s index.php file in a text editor
    2. 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' );
    3. Save and upload the file.
  6. Login to your site (if you aren’t still already). The URL should still be http://example.com/wordpress/wp-admin/
  7. 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.)

Since the site is not working for some of these steps, it is best to make this change at a time of low activity, e.g., the middle of the night.

If you already have content in your site, see when your domain name or URLs change for how to deal with references to the old URL that will remain in the database.

——–

Jill
--------------
J. Olkoski
Aldebaran Web Design, Seattle
Jill Olkoski has a BS in Engineering, a BS in Computer Science and an MA in Clinical Psychology. She delights in using her advanced technical and psychological skills to help small business owners develop cost-effective and successful websites.



Comments are closed.



 ©2006 - © Aldebaran Web Design Seattle, A DBA of Aldebaran Services LLC
Search Blog Articles: