Viewing 4 replies - 1 through 4 (of 4 total)
  • Effectively, what you are doing is not installing in a sub-directory – you are using a sub-domain within which WordPress is installed in its root directory.

    You need to change both the “Site Address” and the “WordPress Address”

    Just to be safe, add a .htacess file here /fun/.htaccess and put this in the file:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} !fun.someotherwebsite.com$ [NC]
    RewriteRule ^(.*)$ https://fun.someotherwebsite.com/$1 [L,R=301]

    Also, you’ll probably need to update the post content – use this:

    UPDATE wp_posts SET post_content = REPLACE(post_content, ‘mywebsite.com/fun’, ‘fun.someotherwebsite.com/’);

    Thread Starter admorrow

    (@admorrow)

    Oh Shannon, you’re my hero!

    I got to thinking of it a certain way and it was wrong. You got it right – changed the “Site Address and “WordPress Address” to https://fun.someotherwebsite.com and it works.

    Now, as this is a fresh WP install, does your last recommendation about updating the post content still apply? (And if so, that’s a command to run on phpmyadmin, right?)

    Updating the content (pages, posts, etc) is a lot more tricky, aminly because the URL’s are stored in either lumps of plain text, or in serailised arrays which are very tricky to replace correctly.

    The good news is that there’s a great tool that I use all the time for doing this.

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    I normally use the V. 2 one, but the newer V. 3 works fine as well.

    Yes, the URL’s in post-content will always use the URL that is set in site_url/home-url (can’t remember which one exactly)

    I would do it to be safe.

    The link stored in serialised arrays are generally header images etc which are set in Appearance -> Customise or other plugins… I normally do these manually.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Proper setup of subdirectory install with subdomain pointing to it’ is closed to new replies.