Websites stopped working after upgrade to latest release 1.3.9

  • Hi,


    I noticed some of my clients complained about websites, that are not working properly, after the recent upgrade to the version 1.3.9 of I-MSCP.
    We have a number of sites, that use mod_rewrite to modify url patterns on their wordpress based blogs. Some of them doesn't work anymore.


    If we rewrite URLs, that use .php at the end, they don't work anymore and throw an error 404:


    Example:

    Code
    1. <IfModule mod_rewrite.c>
    2. RewriteEngine On
    3. RewriteBase /
    4. RewriteRule ^index\.php$ - [L]
    5. RewriteCond %{REQUEST_FILENAME} !-f
    6. RewriteCond %{REQUEST_FILENAME} !-d
    7. RewriteRule . /index.php [L]
    8. </IfModule>

    Now we have the URL http://www.domain.tld//3-main-tipps.php which throw an error 404. (Previously, using I-MSCP 1.3.0 that website was able to load correctly).
    I assume, it is becasue in the apache configuration the .php extension is now rewritten to the fcgi handler and overrides the .htaccess of the customer.


    Is there a workarround for this ?


    Best regards


    Koren

    I-MSCP 1.3.9 on Debian Linux 8

  • My wordpress with the following htaccess:



    Works perfectly with changes made in i-MSCP version 1.3.9 regarding mod_proxy_fcgi_handler (rewrite rule that is responsible to enable fcgi handler only when the PHP script exists).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @Koren


    Warning: Issue related to i-MSCP apache2_php_fpm httpd server implementation only (with mod_proxy_fcgi)


    Howto repropduce the issue

    • Set custom permalink (Permalink settings) such as /%post_id%-%postname%.php
    • Create a new post with main-tipps as title

    Try to browse URL: http://domain.tld/24-main-tipps.php


    Note that the ID can differs on your installation.


    Result


    Default i-MSCP 404 page is displayed


    Expected result


    Newly created Wordpress post should be displayed


    How to fix


    Edit the Apache2 vhost file of the domain and add RewriteOptions Inherit to end with something as follow:

    Code
    1. ...
    2. RewriteEngine on
    3. RewriteOptions Inherit
    4. <FilesMatch \.ph(p[3457]?|t|tml)$>
    5. RewriteCond %{REQUEST_FILENAME} -f
    6. RewriteRule .* - [H=proxy:fcgi://domain.tld,NC]
    7. </FilesMatch>
    8. ...


    Once done, reload apache2: service apache2 reload


    Will be fixed in next version.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • A fix has been added in the 1.3.x branch. See https://github.com/i-MSCP/imsc…74cedc2820ff152ca0222d48f
    This fix will be part of next i-MSCP version.


    Thank you for your report.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Thank you very much for your work :-) The solution works perfectly!
    I don't know WHY that client used that stuff with .php extensions for mod_rewrite rule. But i guess he will be happy when we deploy that fix.


    Best regards


    Koren

    I-MSCP 1.3.9 on Debian Linux 8

  • @Koren


    You're welcome. Thank you for your donation ;) That is much appreciated ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206