• Resolved ImageArno Kools

    (@arno-kools)


    Plugin version: 6.7.1.

    I’ve noticed the plugin clashes with some rewrite rules.
    For example, when I test updates in my local environment I use rewrite rules to load missing images from the live server. This omits the need to download the uploads folder.

    But the plugin stops/breaks/prevent these rewrite rules.

    rewrite rules:

    <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteBase /
    
      # Load (media) files from production server if they don't exist locally
      RewriteCond %{HTTP_HOST} ^local.mysite\.com
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^wp-content/(.*)$ https://mysite.com/wp-content/$1 [NC,L]
    </IfModule>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor ImageOnPoint Plugins

    (@onpointplugins)

    Hi Arno,

    Looking at the rewrite rules it appears they are looking for the “local.mysite.com” domain before they perform any rewriting. If you change your domain to something other than “local.mysite.com” using the Go Live plugin or any other method of updating the domain, the rewrite rules will no longer function.

    To allow the rewrite rules to function after a domain change you may remove the following line.
    RewriteCond %{HTTP_HOST} ^local.mysite\.com

    If you have updated your local environment to same domain as the live server the rewrite rules will no longer work regardless of the above suggestion because the rewrite rules will redirect back to your local environment and still not find the images.

    One approach for making the rewrites work is to add a secondary domain to your live server, something like “images.mysite.com” which points to the same location as the main domain “mysite.com”. If you then update the rewrite rule to point to it, you can switch your local to your live domain and still load the images.

    Update

    RewriteRule ^wp-content/(.*)$ https://mysite.com/wp-content/$1 [NC,L]

    To

    RewriteRule ^wp-content/(.*)$ https://images.mysite.com/wp-content/$1 [NC,L]

    Thread Starter ImageArno Kools

    (@arno-kools)

    Thanks for the super fast response.
    You suggestion should work indeed, but adding a subdomain alias/pointer feels like workaround instead of a solution.

    The stated issue only occurs when the plugin is activated.
    When it’s deactivated everything works fine.

    I was asuming this plugin only updates urls in the database once, but it seems it also updates urls on the fly. Is that right?

    Plugin Contributor ImageOnPoint Plugins

    (@onpointplugins)

    The Go Live plugin only updates URL in the database when it is run. Otherwise, it is not supposed to do anything when it is not being run.

    If an issue is happening only when this plugin is activated, then perhaps there is a PHP error being thrown behind the scenes. Are there any clues in the PHP error log?

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Conflict .htaccess rewrite rules’ is closed to new replies.