• Resolved NRNR

    (@nuno-recio)


    Hello,

    Good evening. I wanted to try your plugin but I’m having issues with activating it.

    As soon as I save settings, the changes on the .htaccess file breaks my site and I get
    500 Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request

    after removing the lines created by adaptive images it comes back on.
    I have permalinks on my site

    My htaccess file already had the following lines
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    so the lines added by adaptive images might be conflicting with this

    debug info:

    Debug info
    ✔ PHP GD library is installed.
    ✖ Image cache directory has not been created.
    But this is probably because the cache has not been accessed yet.
    After accessing your website from a mobile device the directory should be automatically created.
    
    /hsphere/local/home/clubetravel/atelierbetula.com/wp-content/cache => drwxr-xr-x
    ✖ Installation .htaccess file is not properly setup.
    /hsphere/local/home/clubetravel/atelierbetula.com/.htaccess => -rw-rw-rw-
    ❖ Adaptive images settings dump:
    array(12) {
      ["resolutions"]=>
      array(3) {
        [0]=>
        int(1024)
        [1]=>
        int(640)
        [2]=>
        int(480)
      }
      ["hidpi"]=>
      bool(true)
      ["cache-directory"]=>
      string(21) "cache/adaptive-images"
      ["watched-directories"]=>
      array(2) {
        [0]=>
        string(18) "wp-content/uploads"
        [1]=>
        string(17) "wp-content/themes"
      }
      ["jpeg-quality"]=>
      int(75)
      ["sharpen-images"]=>
      bool(true)
      ["watch-cache"]=>
      bool(true)
      ["browser-cache"]=>
      float(180)
      ["landscape"]=>
      bool(false)
      ["cdn-support"]=>
      bool(false)
      ["version"]=>
      string(6) "0.6.42"
      ["sanitized"]=>
      bool(true)
    }

    Is there anything I can do? 🙂

    thx

    My site: http://atelierbetula.com/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter NRNR

    (@nuno-recio)

    Plugin Author Takis Bouyouris

    (@nevma)

    Hello, my friend,

    I am so sorry to hear this. If it is not too much trouble could you temporarily enable the plugin and save its settings and send me the part of the htaccess file that it creates, so I can have a look at it and see what might be wrong there?

    Cheers,
    Takis

    Thread Starter NRNR

    (@nuno-recio)

    Hi Nevma,

    Sure, here it goes
    The plugin creates this:
    # BEGIN Adaptive Images
    #=======================

    <IfModule mod_rewrite.c>

    RewriteEngine On

    # Watched directories
    RewriteCond %{REQUEST_URI} /wp-content/uploads [OR]
    RewriteCond %{REQUEST_URI} /wp-content/themes

    # Redirect images through the adaptive images script
    RewriteRule \.(?:jpe?g|gif|png)$ /wp-content/plugins/adaptive-images/adaptive-images-script.php [L]

    </IfModule>

    # END Adaptive Images

    I have already have the following rewrite rules defined (from git hub apache settings):

    # ----------------------------------------------------------------------
    # | Error prevention                                                   |
    # ----------------------------------------------------------------------
    
    # Disable the pattern matching based on filenames.
    #
    # This setting prevents Apache from returning a 404 error as the result
    # of a rewrite when the directory with the same name does not exist.
    #
    # https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
    
    Options -MultiViews
    
    # ----------------------------------------------------------------------
    # | Rewrite engine                                                     |
    # ----------------------------------------------------------------------
    
    # (1) Turn on the rewrite engine (this is necessary in order for
    #     the <code>RewriteRule</code> directives to work).
    #
    #     https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
    #
    # (2) Enable the <code>FollowSymLinks</code> option if it isn't already.
    #
    #     https://httpd.apache.org/docs/current/mod/core.html#options
    #
    # (3) If your web host doesn't allow the <code>FollowSymlinks</code> option,
    #     you need to comment it out or remove it, and then uncomment
    #     the <code>Options +SymLinksIfOwnerMatch</code> line (4), but be aware
    #     of the performance impact.
    #
    #     https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
    #
    # (4) Some cloud hosting services will require you set <code>RewriteBase</code>.
    #
    #     https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
    #     https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
    #
    # (5) Depending on how your server is set up, you may also need to
    #     use the <code>RewriteOptions</code> directive to enable some options for
    #     the rewrite engine.
    #
    #     https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
    #
    # (6) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
    #     appropriate schema automatically (http or https).
    
    <IfModule mod_.c>
    
        # (1)
        RewriteEngine On
    
        # (2)
        Options +FollowSymlinks
    
        # (3)
        # Options +SymLinksIfOwnerMatch
    
        # (4)
        RewriteBase /
    
        # (5)
        RewriteOptions <options>
    
        # (6)
        RewriteCond %{HTTPS} =on
        RewriteRule ^ - [env=proto:https]
        RewriteCond %{HTTPS} !=on
        RewriteRule ^ - [env=proto:http]
    
    </IfModule>
    
    # ----------------------------------------------------------------------
    # | Filename-based cache busting                                       |
    # ----------------------------------------------------------------------
    
    # If you're not using a build process to manage your filename version
    # revving, you might want to consider enabling the following directives
    # to route all requests such as <code>/style.12345.css</code> to <code>/style.css</code>.
    #
    # To understand why this is important and even a better solution than
    # using something like <code>*.css?v231</code>, please see:
    # http://www.stevesouders.com/blog/2008/08/23/revving-filenames-dont-use-querystring/
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.+)\.(\d+)\.(bmp|css|cur|gif|ico|jpe?g|js|png|svgz?|webp|webmanifest)$ $1.$3 [L]
    </IfModule>
    
    # ----------------------------------------------------------------------
    # | EXISTENTE                                                          |
    # ----------------------------------------------------------------------
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    So whenever I try to insert the rule to redirect image files to the plugin, it crashes my site.
    Have any idea what it could be?

    Also after crashing, i have to redefine permalink structure to postname again, because my posts then give me a 404 error

    thx

    Plugin Author Takis Bouyouris

    (@nevma)

    Sorry, for all this trouble. We ‘ll get to the bottom of this! It seems that there might be some combination with your existing htaccess rules that causes the problem.

    Please, allow me to put you through one more experiment, if I may!

    Could you remove all the other htaccess entries, apart from WordPress core entries, of course, then reactivate the plugin and then save its settings once more? This way we will definitely know if the problem is a bug in the plugin itself or whether the plugin conflictswith some of the other entries you have added in your htaccess file.

    Cheers,
    Takis

    Thread Starter NRNR

    (@nuno-recio)

    Hello,

    I’ve tried activating the plugin with only the following code on my htaccess (to be able to use permalinks):

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

    It has resulted in a 500 internal server error

    Do you have any ideas of overcoming this?
    thx for your support

    Plugin Author Takis Bouyouris

    (@nevma)

    You are very welcome!

    Yes, this was exactly what I meant. So, it seems that the problem has nothing to do with your other htaccess entries. Now, I have to ask if you can spot any entries in your error log files. Does your host allow you access to PHP error log files?

    Thread Starter NRNR

    (@nuno-recio)

    Hi,

    I do not have access to error log files. I’ll create the error log in two days time, because I do not have time now to handle this

    talk to you then
    thx

    Plugin Author Takis Bouyouris

    (@nevma)

    Hello, there,

    Any news on the issue? Should we close this thread?

    Cheers,
    Takis

    Thread Starter NRNR

    (@nuno-recio)

    done, and sorry for the delay 😉

    Plugin Author Takis Bouyouris

    (@nevma)

    Thank you for the update, my friend!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘500 Internal Server Error’ is closed to new replies.