Community Forums › Forums › Archived Forums › General Discussion › Different Image URL's and Domain Mapping
Tagged: featured images, URL Structure, Wordpress Network
- This topic has 7 replies, 2 voices, and was last updated 9 years, 10 months ago by Lauren @ OnceCoupled.
-
AuthorPosts
-
June 19, 2014 at 6:42 pm #110696xandalineMember
Here is the setup:
1. WordPress Network using subdomains xyz.mynetwork.com
2. Subdomains mapped to a unique URL i.e. xyz.com using: WordPress MU Domain MappingHere is what I noticed. The featured images URL's on the home page are xyz.mynetwork.com/wp-content/uploads/sites/15/2014/06/logo-300x162.png
But when I view a post or page the image URL's are what I want them to be e.g. XYZ.com/wp-content/uploads/sites/15/2014/06/logo-300x162.png
Why do the child themes do this and is there a way I can have the home page images use the same URL structure as the individual posts e.g. xyz.com instead of xyz.mynetwork.com?
The reason I ask is that I'm also using W3 Total Cache with a CDN and it won't use my CDN because of the domain name mismatch.
June 19, 2014 at 7:40 pm #110703Lauren @ OnceCoupledMemberI had this EXACT same problem! OK, not exact. But, featured images with a CDN problem. And I could not find answers anywhere at the time. Anyway, what I discovered (and let me know if this doesn't work for you, because I kept a whole file of notes somewhere about what I did) is in my sites, I had to completely delete the path for the site I was mapping. That is, my path was /oncecoupled/ (see, not exactly the same problem, I didn't use subdomains...) which I edited it and removed, then changed the domain from the original (ie mynetwork.com) to oncecoupled.com (ie xyz.com).
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
June 19, 2014 at 8:18 pm #110705xandalineMemberThank you for the response! I'm glad to hear I wasn't the only one. I changed the subdomain from /xyz.mynetwork.com to just "/". Saved it; then, put it back to xyz.mynetwork.com. Unfortunatly that didn't work. What is your understanding of what caused the fix? For example did this trick WP into thinking that this network site was really living at the root i.e. "/"? Worst case scenario I can hack around in the database and force it to mold to your solution.
June 19, 2014 at 8:41 pm #110710xandalineMemberUpdate: I bashed around the database and changed these two values in the "Options" table:
option_name | option_value
siteurl | xyz.com
home | xyz.comThis has fixed it. Now home page URL's are xyz.com instead of xyz.mynetwork.com.
Who says trouble shooting after a drink or two was unproductive. 🙂
June 19, 2014 at 8:53 pm #110711Lauren @ OnceCoupledMemberOK, I don't quite recall all of the details. What I do remember is that my images weren't being handled properly by the CDN.
In the end, the discovery that prompted the soluation was seeing that my site was at http://oncecoupled.com, but if I went into my images' edit screen, the URL that would show http://hostdomain.com/oncecoupled/...etc.
By changing the site settings (that is, removing the path and changing the domain) I was able to verify that my changes had been successful by viewing my media again and now seeing the URL was http://oncecoupled.com/wp-content/...etc.
After the URLs were fixed, my CDN was able to grab all the files properly and handle my site with the images.
Since that's kind of a vague explanation of the changes that "did the trick" for me, here's a before and after:
http://screencast.com/t/is0HyxyR9
http://screencast.com/t/CIWAUjEGR
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
June 19, 2014 at 8:58 pm #110712Lauren @ OnceCoupledMemberBTW, found the post that originally helped me! It's sub-domain specific, so it should be perfect for you: http://wordpress.org/support/topic/featured-image-paths-in-mapped-subdomains?replies=9#post-3906844
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
June 19, 2014 at 9:02 pm #110713xandalineMemberThank you again for the assist Lauren! Your feedback got me thinking about how the theme has to operate. By tweaking the two columns in the "options" table I was able to solve the problem. Now my home page is loading with multiple subdomain CDN glory: http://snakeoilsocial.com/
June 19, 2014 at 9:49 pm #110722Lauren @ OnceCoupledMemberBeautiful! I've been waiting for the day when my struggles with this would be helpful! I'm glad you were able to find your solution, even if it wasn't the same solution I was providing. 🙂
We create mobile-first, PageSpeed-optimized, pixel-perfect custom themes! https://www.oncecoupled.com
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.