WordPress.org

Ready to get started?Download WordPress

Forums

Featured image paths in mapped subdomains (9 posts)

  1. Fraser Martin
    Member
    Posted 1 year ago #

    I have a fresh multisite installation set up on:

    mydomain.com

    with 2 subdomains added to the network:

    sub1.mydomain.com
    sub2.mydomian.com

    In cPanel, 2 parked domains have been configured: sub1.com and sub2.com and point to the public_html folder of the primary domain.

    I have installed the WordPress MU Domain Mapping Plugin. (only option 2 is checked).

    Everything appears to be working correctly except for the paths of featured images served from the mapped subdomains.

    All images show up correctly in the primary domain and in the mapped subdomains.

    But Featured Images in any of the mapped subdomains are being served from:

    sub1.mydomain.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    instead of:

    sub1.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    This does not happen with any images inserted into the post body. They are all correctly served from sub1.com/etc

    Is this normal behaviour for Featured Images on a MU install?

  2. But Featured Images in any of the mapped subdomains are being served from:

    sub1.mydomain.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    Where? On the front end of the site or...

  3. Fraser Martin
    Member
    Posted 1 year ago #

    Thanks Mika.

    Both back and front.

    I have a maintenance plugin installed during the build, but I have tested it with the plugin disabled and a different browser with cleared cache.

    I can edit the URL in the address bar and it successfully fetches from:

    eg.

    sub1.mydomain.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    and

    sub1.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    But in the html for the page it is being served as
    sub1.mydomain.com/wp-content/uploads/sites/3/2013/02/5090536_m-708x400.jpg

    I stress again, that this is only occurring with Featured Image. Images inserted into posts are working as expected.

  4. Fraser Martin
    Member
    Posted 1 year ago #

    Also there are no caching plugins in use.

  5. Have you tested on a different theme, like TwentyTwelve?

    I'm domain mapping and all my images show up correctly.

  6. Fraser Martin
    Member
    Posted 1 year ago #

    Just tried it now, same result.

    I'm travelling until Monday, will check out the database tables when I get back.

  7. Fraser Martin
    Member
    Posted 1 year ago #

    Problem solved (I think).

    Everything being saved correctly in the postmeta table.

    So checked the Network Admin->Sites->Edit Site

    and manually changed the Info->Domain setting

    from: sub1.mydomain.com

    to: sub1.com

    Everything appears, so far to be working.

    I thought that MU Domain Mapping Plugin would have changed this value after the Domain Mapping had been set. Obviously not.

  8. Fraser Martin
    Member
    Posted 1 year ago #

    When I made that edit change I also had the checkbox

    Update siteurl and home as well

    ticked as well. So that may have changed the necessary setting to make the featured image paths correct.

  9. You really shouldn't have to do that. That's very odd...

Topic Closed

This topic has been closed to new replies.

About this Topic