it would be interesting to see what the " infection" looks like. you probably will find it in the /cgi-bin folder, or in the .php scripts in the /public_html folder.
that's why i recommend people to either use "static" website builders like nanoblogger (and you can do a lot with those, even having embedded audio and video, or javascript code) or read everything they can get their hands on about locking down security on PHP, CGI, and SQL. javascript, embedded video, embedded audio, all execute in the browser, but PHP, CGI, and SQL execute on the server, which is why they get attacked. if PHP code isn't locked down, somebody can enter data in a form, add a semicolon, and a command line, and the command line will execute on the server. when testing stuff like IOT devices, i try the following in the password prompt:
password ;reboot
if the IOT device reboots, it's got a serious security flaw that allows a form entry to be used to enter commands. password forms are usually php scripts. another thing that can ruin your day, is SQL injection. if you have a user database with passwords, etc... and someone does this on the form (we'll use the password entry again)
password ;DROP_TABLE "users";
your user database just went bye-bye...
commands entered like that can copy files from outside the website into the website's root directory, the cgi-bin directory. they can upload a hacked copy of your index.html file with javascript code that will load malware onto the user's computer through weaknesses in the user's browser. these can be blocked by proper configuration of PHP, SQL databases, and the http server