Moving WordPress at Subdomain to DocumentRoot

After switching from being an addon domain to the main domain, the moving of files were rather smooth-going. Most of the WordPress continues to work. However, there’s one issue that borders me.
Whenever I upload a graphic file, WordPress would create a new folder under the root directory – wp-content/uploads/YYYY/MM/imagefiles.png.
That was not what it should have been. I had move the subdomain to a new DocumentRoot, so the uploading of graphics should be inside the new DocumentRoot and not create a new directory under the root directory.
Though the upload was successful, the files were added to but not showing up in Media Library.
As expected, nothing shows up when I try to insert the image file into a post.
I was rather puzzled. Days of searching for a fix produced no results.
No forum could supply the answer. But from what I gathered, the problem lies with the .htaccess. It may just requires a slight modification, but I do not know how to.
I need a working sample to copy from, I can’t write one myself. The .htaccess is one file I dare not meddle with unless I know exactly what I’m doing.
Further search for “change path media upoad of wp in subdomain” point me to these files:

  • wordpress.org/support/topic/how-to-change-the-default-media-upload-location
  • www.wpbeginner.com/wp-tutorials/how-to-change-the-default-media-upload-location-in-wordpress-3-5/
    Close, but not exactly what I was searching for. I wanted the default setting, not help on change to default setting:
    It was a search phrase like this “WordPress at subdomain moved to documentroot now upload cannot work” that I got me into this arcticle:
    smallbusiness.chron.com/move-wordpress-sub-root-49487.html
    When I read to Step 5, it says,

    Select “Settings,” “Media” and then change the URL in “Store uploads in this folder” to represent your new URL.

    That’s it. I didn’t know there’s a setting for media in the Admin area.
    I’ve never seriouly explore this area as different version of WordPress installation shows up differently though they’re updated to the current version.
    In the past, I have never depend on this mode of media uploading. I had always upload image files to my manually created images folder and code the path in my post.
    This is the first time I am using the drag-and-drop mode to upload images.
    Anyway, in the Setting – Media – Uploading files of the Admin Area, I found 2 blank boxes waiting to be filled:

    1. Store uploads in this folder
    2. Full URL path to files

    I filled in the absolute path including the document root and did another upload. Now it works.

Leave a Reply

Your email address will not be published. Required fields are marked *