Viewing 2 replies - 1 through 2 (of 2 total)
  • This is a simple fix to get it working for both Apache 2.2 and 2.4. In the file really-simple-captcha.php, change lines 304-308 from:

    fwrite( $handle, 'Order deny,allow' . "\n" );
    fwrite( $handle, 'Deny from all' . "\n" );
    fwrite( $handle, '<Files ~ "^[0-9A-Za-z]+\\.(jpeg|gif|png)$">' . "\n" );
    fwrite( $handle, '    Allow from all' . "\n" );
    fwrite( $handle, '</Files>' . "\n" );

    to

    fwrite( $handle, '<IfModule !mod_authz_core.c>' . "\n" );
    fwrite( $handle, '    Order deny,allow' . "\n" );
    fwrite( $handle, '    Deny from all' . "\n" );
    fwrite( $handle, '    <Files ~ "^[0-9A-Za-z]+\\.(jpeg|gif|png)$">' . "\n" );
    fwrite( $handle, '        Allow from all' . "\n" );
    fwrite( $handle, '    </Files>' . "\n" );
    fwrite( $handle, '</IfModule>' . "\n" );
    fwrite( $handle, '<IfModule mod_authz_core.c>' . "\n" );
    fwrite( $handle, '    Require all denied' . "\n" );
    fwrite( $handle, '    <Files ~ "^[0-9A-Za-z]+\\.(jpeg|gif|png)$">' . "\n" );
    fwrite( $handle, '        Require all granted' . "\n" );
    fwrite( $handle, '    </Files>' . "\n" );
    fwrite( $handle, '</IfModule>' . "\n" );

    You will probably have to manually delete the .htaccess file out of the wp-content/uploads/wpcf7_cpatcha folder to force it to regenerate the new one.

    Thread Starter Eccola

    (@eccola-www)

    Hi Joshua,
    thank you for this fix!

    I wouldn’t touch the plugin files, but I hope this reaches the plugin developers.

    Meanwhile, I just fixed the .htaccess in /wpcf7_captcha/ :

    <Files ~ "^[0-9A-Za-z]+\.(jpeg|gif|png)$">
        Require all granted
    </Files>

    This works ok, but still waiting the plugin update.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wpcf7_captcha htaccess on Apache 2.4’ is closed to new replies.