WordPress.org

Forums

[resolved] Multisite Subdirectory weird image paths (14 posts)

  1. ryHollingsworth
    Member
    Posted 1 year ago #

    Clean multisite install using subdirectories done on the root level so nothing fancy.

    Image uploads are working fine for the main site, but all sub site images are not working.

    I'm getting a url structure like this when I upload an image:
    http://site.com/subsite/files/2013/12/image.jpg

    when the actual URL for the image should be
    http://site.com/subsite/wp-content/uploads/2013/12/image.jpg

    Images are being uploaded to the proper place, just not called properly in wp-admin, or on the front-end.

    I've tweaked with the htcaccess but have had no success there, here's the original GoDaddy put in there:

    <IfModule mod_rewrite.c>
    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).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    #RewriteRule  ^(.+)?/(wp-.*) /$2 [L]
    RewriteRule . index.php [L]
    
    </IfModule>
  2. When the actual URL for the image should be
    http://site.com/subsite/wp-content/uploads/2013/12/image.jpg

    Actually, the URL should be something like:
    http://domain.com/subsite/wp-content/uploads/sites/site-id/2013/12/image.jpg.

    Can you share a link to the subsite?

  3. ryHollingsworth
    Member
    Posted 1 year ago #

    When I looked at my upload directory I don't have the sites/site-id like you're suggesting. I thought that was odd myself but assumed it was some 3.8 update.

    At the moment I'm trying to figure out why GoDaddy is forwarding the test domain to the live domain so if it's not a responsive layout hit refresh a few times. I considered these may be related (if htcaccess) but don't believe it is due to me not doing anything to point to that live URL anywhere. The WP site should be totally ignorant of the live URL.

    http://www.5thavedigital.com/bj/about/

    if you use a browser which lets you change HTML on the fly you can set the image url to 'http://www.5thavedigital.com/bj/wp-content/uploads/2013/12/headshot.jpg' and it works

  4. OK, so it looks like you are embedding the site into a frame of sorts? Where is the actual WP subsite located? Occasionally it looks fine, http://prntscr.com/2eh5jz. Sorry, I'm confused there's a lot going on there :)

  5. ryHollingsworth
    Member
    Posted 1 year ago #

    Shouldn't be any frames at all. Your screenshot was from the live site, a separate issue i'm on hold with GoDaddy about. (the domain has been set to forward with masking here for a few years and i'm using it for the overhaul.. DNS and site forwarding are all setup proper but still having issues - basically GoDaddy is fighting with itself as to where it wants to point this domain)
    Test Site
    Setup: new hosting, WP multisite at the root directory. Using subdirectories, not subdomains. No plugins at the moment. Nothing fancy going on. The themes are complicated, but that's not going to affect the wp-admin area.

    I could always do a str_replace in the theme to fix the url but that's a hack and not a solution..

  6. I'm getting a url structure like this when I upload an image:
    http://site.com/subsite/files/2013/12/image.jpg

    when the actual URL for the image should be
    http://site.com/subsite/wp-content/uploads/2013/12/image.jpg

    No, files is fine folks.

    * http://site.com/subsite/files/2013/12/image.jpg

    What that means is you have WP Multisite running BEFORE WordPress 3.5 came out, that's all. Patrick's correct with the URL, but that's ONLY if you activated Multisite on 3.5 or later. I know, I know, it's crazy.

    But that said, using /files/ is actually why you have this line in your .htaccess:

    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    You said GODADDY put that .htacess in there? Perchance did you use their installer?

  7. Clean multisite install using subdirectories done on the root level so nothing fancy.

    What that means is you have WP Multisite running BEFORE WordPress 3.5 came out, that's all.

    I figured if it's a clean install it would be the latest version. But looking at the .htaccess it's definitely not!! If GoDaddy ran that install it's quite old...

    http://codex.wordpress.org/Multisite_Network_Administration#.htaccess_and_Mod_Rewrite

  8. ryHollingsworth
    Member
    Posted 1 year ago #

    @Ipstenu Yes, I have done multi sites countless times, this is my first on GoDaddy and I saw a check box for enabling multisite so I gave it a whirl. GoDaddy setup everything with a few tweaks by me (changing default theme for new sites, adding akismet key for network activation and adding sunrise, which i removed temporarily)

    Are you suggesting I reinstall WordPress with 3.8? I don't mind doing it, really won't set me back much at all since it's a vanilla test site. Or perhaps using the pre WP 3.5 htaccess code snippet from wp.org.. I haven't tried that yet. Out for dinner thanks everyone

  9. Either GoDaddy is installing an old version of WP or for some reason they have an old .htaccess packed with their 3.8 installer. Since it's just a test site you'd probably be best off getting rid of whatever they installed and doing it yourself.

    There's definitely a frame there...

    http://www.5thavedigital.com/bj/about/

    <html>
    <head>
      <title>www.5thavedigital.com</title>
      </head>
    <frameset rows="100%,*" border="0">
      <frame src="http://5thavenuedigital.com/bj/about/" frameborder="0" />
      <frame frameborder="0" noresize />
    </frameset>
    </html>

    Your screenshot was from the live site, a separate issue i'm on hold with GoDaddy about.

    My screenshot, was from the same URL showing the browser, http://www.5thavedigital.com/bj/about/, see : http://prntscr.com/2ehitd, but it's obviously different. That's odd.

  10. andreaml
    Member
    Posted 1 year ago #

    I'm hitting the same issue on my site (GoDaddy multisite install, images not working) but it's not on a test site. Has anyone had any luck updating the settings to resolve the problem?

  11. I would strongly suggest, if you're doing Multisite, you ALWAYS do the install of WP manually yourself. You get a much better feel for the files, which is something you need to learn to be an awesome Multisite Admin.

    andreaml - Same to you. Delete it, start over MANUALLY.

    I love one-click installers, honestly, but if you're getting results like this, it's time to step back and do it yourself. With Multisite this is HUGELY important. You must learn this stuff, and doing it yourself will help you :)

  12. ryHollingsworth
    Member
    Posted 1 year ago #

    Ipstenu, I agree with you, which is why I've done a multisite install manually a few dozen times. Thought I'd give GoDaddy a shot since I never use their hosting services..

    ANYWAYS. After reinstalling WordPress manually I attempted to use the original database table in an attempt to provide a workable answer for andreaml; however, that still did not work. So i deleted the new wp-config.php file and created a new db table and went through the setup process a final time.

    Images are now working properly.

    That may provide a clue as to what the problem is.. something related to the database tables created by the GoDaddy WP installer.

    Hopeful this fix will also make my sunrise.php nested directories hack work :)

  13. Tagged this for GoDaddy so hopefully they can take a look. That's really weird!

  14. andreaml
    Member
    Posted 1 year ago #

    I did some more Googling and found that many people had been having problem with an extra .htaccess file in the wp-includes folder. I tried simply deleting it (didn't have much to lose...) and the image problem was solved. That being said, I'm manually installing my sites in the future... I will say, it's been a positive first learning experience!

Topic Closed

This topic has been closed to new replies.

About this Topic