Title: Subdomain Issue
Last modified: November 10, 2016

---

# Subdomain Issue

 *  Resolved [Turkish Delight](https://wordpress.org/support/users/turkish-delight/)
 * (@turkish-delight)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/)
 * First and foremost, I apologize for what is likely a simple error. I have tried
   a variety of methods to correct this and each has failed.
 * I am using the most recent version of this plugin and WP 4.6.1. There are no 
   custom themes and no additional plugins, everything is a vanilla install of WordPress
   and this module.
 * I have a subdomain set up, “[http://cdn.example.com&#8221](http://cdn.example.com&#8221);,
   and a path in public_html “/example-path/uploads”. Both directories have 755 
   permissions.
 * Within the module settings, I have these fields:
 * – Store uploads in this folder: /example-path/uploads/
    – Full URL path to files:
   [http://cdn.example.com/example-path/uploads/](http://cdn.example.com/example-path/uploads/)
 * When trying to upload a simple image, I receive this error: “Unable to create
   directory uploads/2016/11. Is its parent directory writable by the server?”
 * I have also removed the “/” in the path settings, so it would read:
 * – Store uploads in this folder: example-path/uploads
    – Full URL path to files:
   [http://cdn.example.com/example-path/uploads](http://cdn.example.com/example-path/uploads)
 * In this case, I get a false positive for uploads. The media library shows that
   the image was successfully processed, however the 2016/11/ directories were not
   created and an image does not exist.
 * I have tried quite a bit, but unfortunately I am having a lot of trouble with
   what seems to be a simple configuration. Any advice here is welcome. Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Plugin Author [RVOLA](https://wordpress.org/support/users/rvola/)
 * (@rvola)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8418866)
 * Hi [@turkish-delight](https://wordpress.org/support/users/turkish-delight/)
 * Everything is almost good.
    The second field should only be `http://cdn.example.
   com` because it already advanced in the `example-path/uploads`
 * It has been necessary to `example-path/uploads/` if the cdn pointing to the root**
   public_html** server
 * So to summarize:
    1.  field 1: `example-path/uploads`
    2.  field 2: `http://cdn.example.com`
 *  -  This reply was modified 9 years, 6 months ago by [RVOLA](https://wordpress.org/support/users/rvola/).
    -  This reply was modified 9 years, 6 months ago by [RVOLA](https://wordpress.org/support/users/rvola/).
 *  Thread Starter [Turkish Delight](https://wordpress.org/support/users/turkish-delight/)
 * (@turkish-delight)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8420924)
 * I attempted this suggestion, and unfortunately it is not working. What seems 
   to happen is “example-path/uploads/2016/11” directories are made on the local
   server, not the CDN host. I will reattempt a few options and post back to this
   thread, however if you have any thoughts as to what might be wrong, I appreciate
   any input. Thank you!
 *  Plugin Author [RVOLA](https://wordpress.org/support/users/rvola/)
 * (@rvola)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8420993)
 * It is not retroactive. Tries to upload an image with the new settings
 *  Thread Starter [Turkish Delight](https://wordpress.org/support/users/turkish-delight/)
 * (@turkish-delight)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8421000)
 * I have attempted a few uploads with the new settings, and the files are being
   dropped still into the local server.
 * Again I am very sorry to bother you with this, I expect that whatever the problem
   is it must be something simple.
 *  Plugin Author [RVOLA](https://wordpress.org/support/users/rvola/)
 * (@rvola)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8421046)
 * Normally when you have a bad settings the database saves the URL of the image.
   You should try to right-click the image that is not displayed in the administration
   and look at the URL. Then look in the ftp or the image has been positioned. By
   deducing the two you will find out where the problem comes from
 *  Thread Starter [Turkish Delight](https://wordpress.org/support/users/turkish-delight/)
 * (@turkish-delight)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8421096)
 * Very interesting.
 * In wp_posts, the “guid” of this image is [http://cdn.example.com/2016/11/image01.jpg](http://cdn.example.com/2016/11/image01.jpg)
   
   In the media library, the URL is the same as above. However, this image appears
   in the local FTP, not the CDN subdomain. The path for the image is “/example-
   path/uploads/2016/11/image01.jpg”
 * The WP Media URL settings are as follows:
 *  field 1: example-path/uploads
    field 2: [http://cdn.example.com](http://cdn.example.com)
 *  Plugin Author [RVOLA](https://wordpress.org/support/users/rvola/)
 * (@rvola)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8421136)
 * OK now set sub domain so that the pointing folder is: example-parh/uploads
 *  Thread Starter [Turkish Delight](https://wordpress.org/support/users/turkish-delight/)
 * (@turkish-delight)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8421491)
 * Okay I figured it out. There a few issues regarding the path and ownership that
   I ran into. What I did not mention (I didn’t think it was relevant) is that cdn.
   example.com and example.com are hosted in two different hosts. To better explain:
 * example.com is host 1. This host has “exampleuser” as it’s account owner.
    cdn.
   example.com is host 2. This host has “cdnexampleuser” as it’s account owner.
 * When I’m running the wordpress site under example.com, I’m uploading all of my
   images into cdn.example.com. That means that my “exampleuser” is trying to access
   the directory I set up for it on cdn.example.com, but “exampleuser” does not 
   have any ownership over this directory.
 * **Step 1:**
 * To change ownership, I SSH’d (you may need to contact your hosting provider if
   SSH is not available) into the cdn.example.com account, accessed the “public_html”
   directory and ran the following command:
 * `chown -R exampleuser:exampleuser example-path/`
 * This means that any directory or file that is placed under the example-path directory(
   including the example-path directory itself) is now owned by “exampleuser”.
 * **Step 2:**
    For the last step, the path is critical. You will find the full 
   scripting path, not just the path from site root. In my fields I have:
 * Store uploads in this folder: /home/cdnexampleuser/public_html/example-path/uploads
   
   Full URL path to files: [http://cdn.example.com/example-path/uploads](http://cdn.example.com/example-path/uploads)
 * *****
 * [@rvola](https://wordpress.org/support/users/rvola/), thank you very much for
   your time. I greatly appreciate your assistance here and your plugin.
 *  Plugin Author [RVOLA](https://wordpress.org/support/users/rvola/)
 * (@rvola)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8422808)
 * OK happy for you that you have found the solution. In the FAQ I had written: 
   attention is not a true CDN

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Subdomain Issue’ is closed to new replies.

 * ![](https://ps.w.org/wp-original-media-path/assets/icon-256x256.png?rev=1659360)
 * [WP Original Media Path](https://wordpress.org/plugins/wp-original-media-path/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-original-media-path/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-original-media-path/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-original-media-path/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-original-media-path/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-original-media-path/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [RVOLA](https://wordpress.org/support/users/rvola/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/subdomain-issue-5/#post-8422808)
 * Status: resolved