• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved Apache - error

404 error is not for "domain not found", but "resource not found" (e.g. a page, a file).

To catch all non-existent subdomains, create a subdomain with the wildard * character, for example *.mydomain.ru. Then place content into its home directory that returns the desired action, e.g. a PHP script that returns a 404 error code. Maybe you can simply choose to redirect the wildcard subdomain to an existing domain.

The question is a different topic. Maybe you can choose to create a separate thread for future add-on questions that have different topics.
The above problem occurred precisely because non-existent subdomains are sent to Plesk in a folder var/www/vhosts/default/htdocs
I deleted it and after a few days (not immediately for some reason) the server stopped working.
I believe that by default, something that does not exist should not work, and in the settings of Plesk for some reason, the reverse is done
 
That is the default behavior of the Apache web server: When a virtual host entry for a non-existing domain cannot be found, the server uses the main (server) domain to answer a request. The document root for that is /var/www/vhosts/default/htdocs. Removing that folder is definitely wrong, because then the server will complain that it is missing its document root directory and it will not be able to respond to many requests properly.
 
That is the default behavior of the Apache web server: When a virtual host entry for a non-existing domain cannot be found, the server uses the main (server) domain to answer a request. The document root for that is /var/www/vhosts/default/htdocs. Removing that folder is definitely wrong, because then the server will complain that it is missing its document root directory and it will not be able to respond to many requests properly.
But when, when accessing any non-existing (arbitrary character set) subdomain, the code 200 is returned - this subdomain falls into the database of the search engines as existing. This is fundamentally not true.
 
I have encountered exactly the same problem. I'd like to ask which configuration file should I change. Since almost all the files have an annotation that the file is auto-generated.
I have Plesk installed on Debian so my directories differs from the ones presented here: Apache and Nginx Configuration Files
I found out that they are in /etc/apache2/ instead.
I found an annotation in one of the files that I should use: /var/www/vhosts/system/[DOMAIN_NAME]/conf/vhost.conf
But I need to set up the global config to use it with all the domains and subdomains, which doesn't have a site attached yet.

Can you provide me the valid config location?
 
Back
Top