• Hello there,

    After searching on this topic and seeing many previous posts and reading all the information …I’m now a bit confused and would like some help please. I’m pretty new and may not be explaining with the correct terminology so if you need more clarification just let me know.

    When I originally installed WordPress I had 2 options for it’s location on my site https://www.mysite.com or https://www.mysite.com/blog for example. I chose the root but as my needs have changed I’d like to move the blog component to a dedicated blog page on my site (www.mysite.com/blog). My aim is to have my home page as a landing/intro page to the remainder of my site. This is where I get confused.

    I’ve read “Codex: Moving WordPress” and “Giving WordPress its Own Directory”. Moving WordPress talks about moving the WordPress files from one location to another on my server (ie: changing my URL)… which is in fact what will happen with the addition of /blog to the root. Giving WP it’s Own Directory discusses having WP power their sites root but not having all the files clutter up the root directory. I want WP to power my whole site (inc the root) but not to site on my root.

    Does this make sense? Have I missed something in the guides?

    Thanks in advance for any help given… I appreciate it.

    Rgds,
    Shaun

Viewing 7 replies - 1 through 7 (of 7 total)
  • Use the instructions in Giving_WordPress_Its_Own_Directory.

    Thread Starter okeefefamily

    (@okeefefamily)

    Thanks esmi… I think I can do this now.

    Just one quick question though. How do I create the new location for the core WordPress files to be stored …ie: where the blog will now be relocated to …ie: https://www.mysite.com/blog

    Thanks again.

    Rgds,
    shaun

    blog will be a directory in root and then you will have all wordpress files and folder in blog directory

    Thread Starter okeefefamily

    (@okeefefamily)

    Hi esmi and govpatel (and all others),

    I have created a new blog directory and followed the steps in the “Giving WordPress its own Directory” guide. Step 7 says to Copy (NOT MOVE!) the index.php and .htaccess files. I could copy the index.php but couldn’t copy the .htaccess file at all for some reason. Instead I used my FTP program (Filezilla) to copy the previously backed up file across.

    An issue (I think) I noticed is that the .htaccess file had a different “permissions” number in Filezilla so I change it in the public_html folder ….then it created an error log. Anyway, I kept progressing through the remaining steps of the guide

    Code from index.php file below …it includes the additional instructions (in bold) from a login error to my sites wp admin. The Guide says in Step 11 that if there’s an error it will require the update of file permissions in the .htaccess file …however the error originally said line 17 of the index.php file located iin my public_html file. Here’s the code;

    <?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(‘./blog/wp-blog-header.php’); (include_path=’.:/usr/lib/php:/usr/local/lib/php’)
    ?>

    Now when attempting log iin to my site’s WP admin now it comes up with the following error;

    Parse error: syntax error, unexpected ‘(‘ in /home/shaunoke/public_html/index.php on line 17

    Any clues? Thanks in advance folks.

    Rgds,
    shaun

    /** Loads the WordPress Environment and Template */
    require(‘./blog/wp-blog-header.php’); (include_path=’.:/usr/lib/php:/usr/local/lib/php’)

    On line 17 all your suppose to have
    require(‘./blog/wp-blog-header.php’);

    did you add (include_path=’.:/usr/lib/php:/usr/local/lib/php’)

    Thread Starter okeefefamily

    (@okeefefamily)

    Yes I did govpatel… in a previous error it instructed to add that code. Well, that’s how I interpreted it in light of Step 11 of the “Giving WordPress it own directory” guide…

    Should I remove it?

    check your index.php file in blog folder and just copy that file and add blog on line 17

    so you should have

    require(‘./blog/wp-blog-header.php’);

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Moving Worpress from Root to Subdirectory’ is closed to new replies.