• Resolved Reuhno

    (@laboiteare)


    Hello,

    I had to intervene on the site of a customer who was encountering a problem.

    After a long debugging, it turns out that your plugin poses a problem when used at the same time as WPML.

    Indeed, as soon as we consult a page without language n°1 FR, then the htaccess is as follows:

    # BEGIN WordPress
    # The directives (lines) between "BEGIN WordPress" and "END WordPress" are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteRule ^en/wp-login.php /wp-login.php [QSA,L]
    RewriteRule ^fr/wp-login.php /wp-login.php [QSA,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    As soon as we consult a page in language number 2 (EN), then the .htaccess is the following

    # BEGIN WordPress
    # Les directives (lignes) entre ? BEGIN WordPress ? et ? END WordPress ? sont générées
    # dynamiquement, et doivent être modifiées uniquement via les filtres WordPress.
    # Toute modification des directives situées entre ces marqueurs sera surchargée.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /en/
    RewriteRule ^index\.php$ - [L]
    RewriteRule ^en/wp-login.php /en/wp-login.php [QSA,L]
    RewriteRule ^fr/wp-login.php /en/wp-login.php [QSA,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /en/index.php [L]
    </IfModule>

    All this is problematic, on the one hand because the .htaccess file does not have to be written each time it is loaded.

    On the other hand, because it generates many 500 errors.

    Also, I would like to point out that this is happening with the latest version, i.e. Version 2.11.0
    (WPML is 4.6.9 )

    Could you correct this please?

    • This topic was modified 9 months, 1 week ago by Reuhno.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support saadali2905

    (@saadali2905)

    Hi Reuhno,

    Thanks for writing to us.

    We want to let you know that we have just conditionalize the flush_rewrite_rules in our new update that will only execute for our jobpost.

    Kindly try changing the permalink from “Settings” > “Permalinks” and set it to the “Post name” and try again.

    Feel free to contact us for any further assistance.

    Regards

    Thread Starter Reuhno

    (@laboiteare)

    Thank you very much for the quick response,
    nevertheless, it is still not good.

    I tried all of that, I just did the same thing again just now.

    If you are talking about version 2.11.0, I can assure you that it always generates a new .htaccess file every time the page loads.

    As said previously, this htaccess is re-generated when you change the language in the frontend.

    Thread Starter Reuhno

    (@laboiteare)

    Hello,

    Did you see my last message ?
    Any update about this bug ?

    Plugin Support saadali2905

    (@saadali2905)

    Hi Reuhno,

    Hope you are well.

    Kindly try deactivating the WPML plugin, and try again that if the issue is causing from our plugin. As we have added a specific condition to not to write the rules everytime.

    Regards
    Saad Ali | WP Plugin Developer

    Thread Starter Reuhno

    (@laboiteare)

    Hello,

    As I said previously, the problem occurs with your plugin IF WPML is activated.

    WPML All alone; No problem
    WPML + Your plugin: The htaccess is constantly refreshed

    Regards

    Plugin Support saadali2905

    (@saadali2905)

    Hi Reuhno,

    Hope you are well.

    Kindly contact us on our support at [email protected].

    Regards

    Thread Starter Reuhno

    (@laboiteare)

    Hello,

    I made so further investigations.

    I found the portion of your code that triggers the bad flush of rewrite rules !

    In class-simple-job-borard-post-type-jobpost.php , on line 52, you made a call to flush_rewrite_rules() fuction. But this functions triggers every times, even if custom post is already defined.

     public function simple_job_board_init() {
    
                if ( !post_type_exists('jobpost') ) {
                    
                    // Register the custom post type
                    $this->createPostType();
            
                    // Flush Rewrite Rules only when registering the custom post type
                    flush_rewrite_rules();
                }
    

    Can you see this problem?
    And do you think you can fix it?

    • This reply was modified 9 months ago by Reuhno.
    Plugin Support saadali2905

    (@saadali2905)

    Hi Reuhn0,

    Kindly contact us on our support at [email protected] so that we can provide you with a fix so that you can test it.

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘WPML / Flush Rules issue’ is closed to new replies.