[Snapshot Pro] Conflict between WPML and Snapshot Pro

Hi,
After activating Snapshot Pro on a website using WPML, I've got error 500 on pages related to secondary languages. On log files, error message was "AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace." Disabling Snapshot Pro solved the issue, so it's definitely related to this plugin.
I set Snapshot Pro to FTP destination, which works smoothly on other websites (not using WPML). Issue occurred even when snapshot wasn't generated.
Sorry, but I think it's a bug :wink:
Best regards

  • Predrag Dubajic

    Hi Catherine,

    Hope you're doing well :slight_smile:

    I checked your site with Snapshot enabled but I couldn't see the issue, I tried editing page with translation and also viewing it on frontend but both loaded fine for me.

    I also installed WPML and all the other WPML add-ons that you have on my test installation but I couldn't see any issues there as well when Snapshot is active.

    Could you provide us with some steps we could follow in order to see the issue?

    Best regards,
    Predrag

  • Predrag Dubajic

    Hi Catherine,

    When you said that there's a 500 error I thought I would see it on your site, because 500 usually means fatal error and even if the debug log is enabled it breaks the page and shows a white screen.

    I tried doing another test with the provided steps, and I used Snapshot to export settings from your site and import it to my local installation, so I had pretty much the same setup but there were still no errors on my end I'm afraid.

    Strange thing is that Snapshot doesn't do any redirects so it shouldn't be related to that, it's quite confusing, to say the least.

    I did some research and found some similar reports to WPML and .htaccess configuration, can you check this thread and see if the solution from there works for you?
    https://wpml.org/forums/topic/fatal-error-why-i-can-not-enter-my-site-anymore/

    Best regards,
    Predrag

  • Catherine

    Hi Predrag,
    I investigated further and reproduced the site on my localhost to allow different tests. I deactivated all extensions but Snapshot and WPML to be sure of the task. Seems it's related to permalink. Thanks for having provided me food for thoughts. Here are what I noticed (sorry if it's not right terms, I'm freely translating from French) :
    Case 1
    WP permalinks : Plain (.../?p=123) and WPML settings : language as parameter (...?lang=da - DK). Everything OK with WPML and Snapshot activated. Nothing in .htaccess (obviously :wink:)
    Case 2
    WP permalinks : Post name (.../exemple-article/) and WPML settings : language as parameter (...?lang=da - DK). Everything OK with WPML and Snapshot activated. Usual .htaccess :

    # 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

    Case 3
    WP permalinks : Post name (.../exemple-article/) and WPML settings : languages in directories (.../ - FR, ../da/ - DK). With WPML and Snapshot activated, problem occurs with error 500 while changing language and navigating. .htaccess content goes back and forth every time I'm changing language. In French (main language), it's usual one :

    # 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

    but changing to Danish, it becomes :

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

    Case 4
    WP permalinks : Post name (.../exemple-article/) and WPML settings : languages in directories (.../ - FR, ../da/ - DK). With WPML activated and Snapshot deactivated, everything is OK. .htaccess stay still, on basic content :

    # 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, when I activate Snapshot with WPML, something has an action on permalinks. I let you investigate what :wink:
    Best regards

  • Predrag Dubajic

    Hi Catherine,

    Just be clear here what's going on so I'm sure we're on the same page, so you have WPML set to directory and Post Name in Permalink settings, now when Snapshot is active and you switch between languages your .htaccess changes this line from this:
    RewriteBase /
    To this:
    RewriteBase /da/
    And when you disable Snapshot and then switch between languages then there's no such change in .htaccess, is that correct?

    I'm asking this because I have configured same setup and changing language doesn't change my .htaccess file, so I want to be sure I'm understanding this properly :slight_smile:

    Best regards,
    Predrag

  • Catherine

    Hi again,

    I've got another website with WPML and Divi (although other plugins are not the same, but I also tested websites with all plugin disabled). So, I installed Snapshot Pro on it and ... no problem at all. Well, I really don't know what happens on the first website. Not an issue with the server, because it's the same issue on production site and localhost. Real big mystery, but maybe it's not necessary to investigate further. I will simply not use Snapshot Pro on this problematic website.

    Best regards.

  • Adam Czajczyk

    Hi Catherine

    Please disregard my post above, I have accidentally hit "post" button before writing the rest of the message :slight_smile:

    I admit I'm wondering about that .htaccess being "dynamically changed". I've run a couple more tests on my end and couldn't force that behavior under any circumstances, though it seems it does happen (I found some references to WPML adding that on the web but, unfortunately, with no explanation or solution).

    I'm thinking of one more small test, if you would be willing to conduct it: what if you actually locked the .htaccess? What I mean is:

    - setting everything up and making sure that there's no changes made to .htaccess (no "RewriteBase /da/")
    - then immediately setting permissions for .htaccess file to 444 (which means that the file is not writable anymore at all)

    Whatever (most likely WPML) is doing the change, wouldn't be able to make it then and if that rule is affecting the case, it wouldn't. The question is though: would WPML work fine then? I'm not able to check it since I'm not able to replicate the behavior but I think it would be worth checking :slight_smile:

    Best regards,
    Adam

  • Catherine

    Hi Adam,

    Actually, setting .htaccess to 444 solves the problem. But I can't set this on live site because it's using iThemes Security Pro, which writes on .htaccess to ban IPs.

    Of course, I also tried to reset WPML settings, but it didn't change anything.

    Seems it's a problem known by WPML at least since 2015, isn't it ? But, as you said, no solution was provided. Looks like the issue is very erratic :anguished: Well, I can't say that WPML is my favorite plugin, but I still didn't find any replacement, unfortunately for Polylang :frowning2:

    Best regards
    Catherine

  • Adam Czajczyk

    Hi Catherine

    Thanks for letting me know about test result.

    Actually, setting 444 for .htaccess is good for security, it's recommended by many "WP hardening" guides :slight_smile: Though, I understand that it's not a solution here due to the way iTheme works - unless you would try Defender's IP banning as it's not writing to .htaccess.

    But you're right, it seems that the issue is known to WPML for quite a long time and there's no real solution to it so far. I also agree that there's no real replacement for it - so far it's definitely the best plugin of that kind, even despite that (and some other...) issues :slight_smile:

    Best regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.