404 error on all pages except the main page

The most common cause of the problem is a missing or damaged .htaccess file.

If there is no .htaccess file in the root folder of the site, you need to create it. The content of the standard .htaccess can be copied fromhere... If the file exists, you need to add directives from the standard .htaccess to it.