Forum Replies Created

Viewing 1 replies (of 1 total)
  • Ok so tit for tat , this is done by a malware or virus on your website which creates .htaccess file in every subdirectory of public_html , to deal with it I have prepared a script for hotfix

    Create a file in home directory of user (/home/exampleuser) with any name such as fix_malware.sh and copy and paste the below content

    #/bin/bash
    
    #This script delets all htaccess files which contain FileMatch keyword
    
    echo "Starting Script"
    
    find ./public_html -name ".htaccess" | while read line ;
            do
                    grep -q "FilesMatch" $line
                    if [ $? == 0 ]; then
                    rm $line
                    else
                    echo not found
                    fi
            done

    after pasting the content make sure to give executable permission to the script file, with command chmod u+x ./fix_malware.sh and atlast run the script by calling ./fix_malware.sh .

    After the script will finish executing you may see your websites working again, but some of them must be misbehaving because of missing htaccess file , sadly you need to find correct htaccess file and paste at the project desired location .

    Note I ran the above commands from home directory (/home/exampleuser) , dont forget to change paths if you are running from any other location.

    Hope this helps
    Happy Coding

Viewing 1 replies (of 1 total)