• Resolved meadeiator

    (@meadeiator)


    First, this plugin is terrific. Whether working with images uploaded through WP or creating my own @2x images for custom themes, it is working beautifully. Thank you!

    The one area I could use some guidance is on the setup for using Server and the .htaccess file. I am running a multisite network w/ subdomains where my primary site is https://www.sample.com and my sub-site is my.sample.com.

    All works well on the primary site (www.sample.com), however, on the sub-site the images are not displaying (there is the standard no-image placeholder).

    Following are the entries I have to my .htaccess file (inlcuding the the WP entries).

    # BEGIN WordPress
    RewriteEngine On
    
    	# BEGIN WP-Retina 2X
    	RewriteBase /
    	RewriteRule \.(?:jpe?g|gif|png|bmp)$ wp-content/plugins/wp-retina-2x/wr2x_retinaimages.php [L]
    	# END WP-Retina 2X
    
    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

    Any suggestions are greatly appreciated. I am very interested in making the server-side work and am willing to test suggestions and provide feedback.

    Thank you in advance for your consideration.

    https://www.ads-software.com/extend/plugins/wp-retina-2x/

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter meadeiator

    (@meadeiator)

    Quick additional note. On images that I have included in my theme folder, those get handled perfectly on both the main site and the sub-site.

    It’s only on images that are getting handled via WP upload and have the /files/… prefix. I suspect I have done something to conflict with the WP Rewrite rules however I’m not informed enough to know what I’ve done wrong. Thanks, again.

    Thread Starter meadeiator

    (@meadeiator)

    I’ve still been trying to make this work, but am having issues. Here is what I have tested and learned in the interim and hope it provides insight for possible suggestion.

    First, on my main site, https://www.domain.com, WP Retina 2x works without issue. If I’m using a retina display and I have retina images it loads them when available. If I’m using a non-retina display, it pulls the normal resolution version.

    For my subdomain, sub.domain.com, I have the following results. For any images that are part of my theme where I have created a @2x image myself and they are located in the theme folder, all works well, whether viewing on a retina or non-retina display and produces the expected results. However, for any images that are uploaded through the WP Media New function, the images do not display at all in the browser. I have checked the img src for the images and they are pointing to the correct location, typically within the /files directory located in my blogs.dir folders. So, it looks like it is returning the correct image address but I get the no image icon. When testing in Firefox and I put in the address to the actual image, I get the message “The image “XYZ” cannot be display because it contains errors.” If I keep the same address in the browser for the image and comment (#) out the .htaccess line for WP Retina 2X and reload, it pulls the normal image.

    Hopefully this will spark an idea. Thanks again.

    Thread Starter meadeiator

    (@meadeiator)

    Jordy,

    I was curious if you had any suggestions, thoughts or experiencing regarding this on subdomain sites. It appears, at least on my end, that for the subdomain site it’s returning an ’empty’ image. Again, only on the subdomain site.

    Thanks in advance for your consideration and for creating a great plugin!

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hello Meadeiator,

    Sorry for the very late reply. I actually tried to look into this but for a few reasons I cannot test it properly. I think I will find some time to give it a try but I might end-up with the same conclusions as you have.

    However, I came accross this thread:
    https://github.com/Retina-Images/Retina-Images/issues/7

    As you may know, the plugin uses Retina-Images for the server-side, so this guy there seems to have exactly the same issue. Would you mind adding a message as well? They probably will do something about it, and I’ll be able to include the changes in the plugin as well. I don’t really want to work and modify it myself as they did a fantastic job on their side, and it seems it is the only real problem now.

    Thanks a lot ??

    Thread Starter meadeiator

    (@meadeiator)

    Thank you for your reply and your suggestion. Heading over to GitHub to pass along my experience as well! Thanks again!

    Plugin Author Jordy Meow

    (@tigroumeow)

    It seems it’s going to work ^^ Okay I will close this thread for now and as soon as the new Retina Images is released I will update the plugin as well ! That would be great if everybody could get done by Monday. Let’s hope ??

    Thread Starter meadeiator

    (@meadeiator)

    FYI, the folks at RetinaImages confirmed that the subdomain problem is related to how WP handles rewrites on files uploaded via WP Media. Given the WP nature of the issue, although they helped me with a workaround for the interim, they feel it is better handled long term via WP Retina 2X. They should have passed along their findings directly to you.

    Thanks for all of your help Jordy and kudos for working with another development group that is as responsive and first class as yours!

    Plugin Author Jordy Meow

    (@tigroumeow)

    This is really excellent! I installed for myself a multisite version of WordPress and I will try to check if everything is working correctly with those changes and will write back to everyone. Hold on ??

    Plugin Author Jordy Meow

    (@tigroumeow)

    Hello again Meadeiator!

    I updated the plugin to a new version. Now it should work! Unfortunately, the multisite WP users will have to update the .htaccess manually (can’t do it properly using WP API) but this is minor. The plugin will tell you to do so anyways (when you are on the settings page).

    Please tell me if it works for you!

    Thread Starter meadeiator

    (@meadeiator)

    All continues to work well after the update to version 0.4! Thanks for all of your efforts!

    Quick question. The prompt on the settings pages does indicate the need for:

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

    Do we not also need?:

    ‘RewriteRule \.(?:jpe?g|gif|png|bmp)$ wp-content/plugins/wp-retina-2x/wr2x_retinaimages.php [L]’

    Or is this being added automatically? I’ve installed/activated/etc. so many times I literally can’t remember how that line got there. ?? I have both and all works perfectly.

    I just add as a point of clarification for others who may use your plugin.

    The combo of your plugin with retinaimages.php is very slick and produces gorgeous results very reliably. Thanks again for adding greater clarity (2X) to our WP worlds!

    Plugin Author Jordy Meow

    (@tigroumeow)

    It’s not needed anymore, and in the case of a multi-site install it shouldn’t be added automatically. It works fine without it right?

    Thanks a lot for your comments ?? The whole experience was great, and I’m glad it’s even working for you now ^^ By the way, thanks for rating it as well :p Thanks againnnnnn !

    Thread Starter meadeiator

    (@meadeiator)

    I have to have both lines or it does not work (i.e. it does not render Retina Images).

    So, my .htaccess is as follows (outside of the WP rewrite rules):

    # WP Retina 2x
    RewriteEngine On
    RewriteRule ^files/(.+) wp-content/plugins/wp-retina-2x/wr2x_retinaimages.php?ms=true&file=$1 [L]
    RewriteRule \.(?:jpe?g|gif|png|bmp)$ wp-content/plugins/wp-retina-2x/wr2x_retinaimages.php [L]
    Plugin Author Jordy Meow

    (@tigroumeow)

    Strange… for me it works with the first line…

    I also have a multisite installation running under a subdomain and wish to enable server side image distribution. I inserted the required code from the theme options into my .htaccess file, but it does not seem to work. The two lines from meadeiator’s last comment also don’t work. Could you point me in the right direction what to do?

    This is how my .htaccess looks right now:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^files/(.+) wp-content/plugins/wp-retina-2x/wr2x_image.php?ms=true&file=$1 [L]
    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]
    
    </IfModule>
    # END WordPress
    Plugin Author Jordy Meow

    (@tigroumeow)

    I have no multisite installation, so it would be a lot of installing/testing unfortunately if I wanted to try…

    Maybe you should just use the client-method? It’s the one used by almost everyone, even Apple is using it. If you find a solution it’s great, but I wouldn’t spend too much time into it, or maybe you can wait for somebody to find the solution…

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: WP Retina 2x] Multisite w/ subDomains & Server-Side’ is closed to new replies.