WordPress.org

Forums

[resolved] File path in second multisite site incorrect! (10 posts)

  1. harikjr88
    Member
    Posted 2 years ago #

    I'm having issues with my site http://www.aperina.com set up as multisite. The main site aperina.com is working all good. However, i have multi-site subdomain set up.. but my my.aperina.com website is uploading images, but not displaying them correctly.

    I have my account set up for DNS wildcard *.aperina.com pointed to my dedicated IP adress (as instructed by multisite).

    My Main site images are stored in: /wp-content/uploads/2013/04/file.png

    My Multi site (my.aperina.com) images are uploaded to: /wp-content/blogs.dir/2/files/2013/04/file.png

    However, in the front end of my.aperina.com, the image is saying that it's in; http://my.aperina.com/files/ Which nothing is actually there.

    It looks like the url is missing "/wp-content/blogs.dir/2" on the multisite site before the /files/2013/04/file.png

    I updated my multisite setting for that site for the upload path, upload Url path, and Fileupload Url to "wp-content/blogs.dir/2/files", But nothing is working... it looks like those settings are not even being propagated (don't work or something)

    Can anyone help me with this?

  2. My Multi site (my.aperina.com) images are uploaded to: /wp-content/blogs.dir/2/files/2013/04/file.png

    However, in the front end of my.aperina.com, the image is saying that it's in; http://my.aperina.com/files/ Which nothing is actually there.

    This is 100% correct for a Multisite that was started pre WP 3.5

    The URL is http://my.aperina.com/files/2013/04/file.png

    That gets translated through your .htaccess file, which calls ms-files.php, which pulls out the actual image.

    What's in your .htaccess?

  3. harikjr88
    Member
    Posted 2 years ago #

    #RewriteEngine On
    #RewriteCond %{HTTP_HOST} ^www.aperina.com [NC]
    #RewriteRule ^(.*)$ http://aperina.com/$1 [L,R=301]

    # BEGIN CI_RETINA
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^(.*)\.(jpe?g|gif|png)$ /home/aperinac/public_html/wp-content/plugins/ci-retina/retinaimages.php [L]
    </IfModule>

    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    redirect /contact /?contact=form

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress
    #
    #php_flag magic_quotes_gpc off
    #RewriteCond %{HTTP_HOST} ^aperina\.org$ [OR]
    #RewriteCond %{HTTP_HOST} ^www\.aperina\.org$
    # RewriteRule ^/?$ "http\:\/\/aperina\.com" [R=301,L]

  4. harikjr88
    Member
    Posted 2 years ago #

    I created a new website on a new domain and installed wordpress 3.5 ... Everything works great here. The files are all pointed correctly, so like you said, I guess it's something to do with wordpress.

    maybe the best thing to do is merge the website somehow to my new server? But i'm sure it's not easy.

  5. No, it's that old WP (3.0 through 3.4) if you set up Multisite, it uses a more complex htaccess which doesn't always work.

    3.5 the images point to /wp-content/uploads/sites/2/... instead :/

    You would have to install everything fresh to get that format. Or you can try these:

    http://halfelf.org/2012/dumping-ms-files/
    http://trepmal.com/2013/03/24/removing-ms-files-php-dependency/

  6. harikjr88
    Member
    Posted 2 years ago #

    I don't want to update wordpress.. it seems a little complicated... but i'm fine to stay on the current version of wordpress.. i just want my files to actually work...

    was my .htaccess correct?

  7. I think it has the right parts, but you edited it in a bad way.

    You NEVER want to edit the WP section, you want to add things above it. However I THINK your problem is that retina image plugin. Turn it off and remove it from your .htaccess

    redirect /contact /?contact=form
    
    # BEGIN WordPress
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress
  8. harikjr88
    Member
    Posted 2 years ago #

    I actually removed the retina plugin code and you are right, that was the issue...

    I installed a different retina plugin and now everything works (well almost - like always)

  9. harikjr88
    Member
    Posted 2 years ago #

    The issue came back... weird.

    Here is my current .htaccess file.

    php_value memory_limit 256M
    php_value max_execution_time 4000
    php_value post_max_size 150M
    php_value upload_max_filesize 150M
    
    RewriteRule ^files/(.+) wp-content/plugins/wp-retina-2x/wr2x_image.php?ms=true&file=$1 [L]
    redirect /contact /?contact=form
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]
    # END WordPress

    i've tried disabling these two lines (also deleteing them)

    RewriteRule ^files/(.+) wp-content/plugins/wp-retina-2x/wr2x_image.php?ms=true&file=$1 [L]
    redirect /contact /?contact=form

    But the issue still existed.

    http://my.aperina.com/?s=bryan

    You can see the the image link is:
    http://my.aperina.com/files/2012/06/BryanNicole-252x107.png

    I made sure i have the Zone file Records set up correctly for subdomain multisite.

    *.aperina.com. 14400 IN A 72.34.36.71

    What am I doing incorrectly now...

  10. harikjr88
    Member
    Posted 2 years ago #

    looking at it.. it looks like a 403 forbidden error..

    http://my.aperina.com/files/2012/06/BryanNicole-252x107.png

    So something is not allowing it to reach that file... or am I wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic