[Hummingbird Pro] PHP execution via .htaccess

To optimise this site, I have been asked to add some code to my server to prevent PHP execution. However my server people say I cannot do this but can via the .htaccess. Is this a solution and if so can you advise me how to do it please.

  • Kris Tomczyk
    • Ex Staff

    Hi Tim

    I hope you are doing good today.

    Prevent PHP execution from Defender is adding those codes in .htaccess file:

    1. .htaccess inside /wp-includes/ folder

    ## WP Defender - Protect PHP Executed ##
    <Files *.php>
    Order allow,deny
    Deny from all
    </Files>
    <Files wp-tinymce.php>
    Allow from all
    </Files>
    <Files ms-files.php>
    Allow from all
    </Files>
    ## WP Defender - End ##

    2. .htaccess inside /wp-content/ folder

    ## WP Defender - Protect PHP Executed ##
    <Files *.php>
    Order allow,deny
    Deny from all
    </Files>
    ## WP Defender - End ##

    If .htaccess files do not exist in that location you can simply add those codes separate in notepad and save as .htaccess.

    Kind Regards,
    Kris