Support » Networking WordPress » Domain Mapping file URLS

  • Resolved dronestudios

    (@dronestudios)


    Hey guys, I tried searching for this answer and couldn’t find anything.

    I just setup a fresh install of wordpress, multisite and domain mapping.

    I have 2 blogs. The main site and a multisite blog.

    Blog1 and blog2.

    My problem is the URLs for the files uploaded to blog2.

    http://www.blog1.com/blog2/files/#/#$%%#.jpg

    Is there a way to get them to be

    http://www.blog2.com/files/#/#$%%#.jpg

Viewing 8 replies - 1 through 8 (of 8 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    The old posts or the new ones?

    Your new image paths, with mapping, should be blog2. The old ones, you would have to sql search replace.

    ETA: By old ‘ones’ I meant posts.

    Brand new ones.

    I noticed that both links work. The problem is that the insert image dialog uses the wrong one.

    http://www.blog1.com/blog2/files/#/#$%%#.jpg

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Interestingly … When I look at my site, with domain mapping, if I insert an image it uses blog2.com/files as it should. You sure you uploaded the image AFTER changing the domain?

    Yeah, I built the whole thing from scratch. No pre existing blogs.

    Here are my configs. Note I am using my hosts file to make this work for now.

    I am using sub-directories not sub-domains if that makes a difference.

    define('WP_ALLOW_MULTISITE', true);
    define( 'MULTISITE', true );
    define( 'SUBDOMAIN_INSTALL', false );
    $base = '/';
    define( 'DOMAIN_CURRENT_SITE', 'blog1.com' );
    define( 'PATH_CURRENT_SITE', '/' );
    define( 'SITE_ID_CURRENT_SITE', 1 );
    define( 'BLOG_ID_CURRENT_SITE', 1 );
    
    define( 'SUNRISE', 'on' );
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]
    RewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]
    RewriteRule . index.php [L]
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    Doesn’t make a difference (and it’s not a matter of your .htaccess or wp-config).

    What options did you tick for the domain mapping plugin? I’m wondering if you DID NOT check the one to force your mapped domain on the wp-admin end…

    Screen shot of the admin area.

    http://i.minus.com/ibb1ishzrsnID9.png

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    *ahem* You have to put something between the >< on an a href 😉

    Sadly I can’t see the image (it’s blocked at my office). There are only five options, man.

    1. Remote Login
    2. Permanent redirect (better for your blogger’s pagerank)
    3. User domain mapping page
    4. Redirect administration pages to site’s original domain (remote login disabled if this redirect is disabled)
    5. Disable primary domain check. Sites will not redirect to one domain name. May cause duplicate content issues.

    Which did you check?

    That was it. Doh! Thanks.

    I unchecked option 4 and everything worked as expected.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Domain Mapping file URLS’ is closed to new replies.