• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

Question Where in Plesk can I configure 301 redirect for non-existing subdomains?

olegos76

New Pleskian
Server operating system version
Rocky Linux 8.10
Plesk version and microupdate number
18.0.62 Update #1
Hello guys.
I am in quite a pickle here :) Please help!

Initial Problem: Google and Yandex robots keep finding subdomains that do not exist!

My server config:
Linux with Plesk Obsidian Web Host Edition - Version 18.0.62 Update #1
Site works in Laravel
Main site is https://mysite.com

... and 3 subdomains that I occasionally use:


BUT Google and Yandex reporting that these subdomains are also found:

I have no idea what they are and would love to get rid of them (or at least hide them from indexing by search engines)
Their own recommendation is to setup redirect 301 to my main site.

What brings complexity, is that I am running my server in: Nginx proxies requests to Apache mode.

Google says that in this case I don't need to make changes to .htaccess, but add the following to my nginx configuration:

server {
listen 80; # Adjust port if needed
server_name ~^(?!(dev|blog)\.).*\.yoursite\.com$; # Negative lookahead to exclude specific subdomains

# Redirect all other subdomains to your main website
return 301 https://yourdomain.com/;
}

Question 1: is this correct?
Question 2: if so, where in Plesk should I stick this code in?
(I tried placing it into "Additional nginx directives" field, but got an error: "Invalid nginx configuration: nginx: [emerg] "server" directive is not allowed here"

Please advise something...

Thank you!
 
Wouldn't be easier to remove any DNS records for those non used sub domains? Or in case your are using a wildcard DNS record to remove that and use specific DNS records instead?

Be aware though that by default mail. records get created which gets used for MX records. You can remove the mail. records, in which case you need to point your MX records to somewhere else too (the root domain for example).
 
Wouldn't be easier to remove any DNS records for those non used sub domains? Or in case your are using a wildcard DNS record to remove that and use specific DNS records instead?

Be aware though that by default mail. records get created which gets used for MX records. You can remove the mail. records, in which case you need to point your MX records to somewhere else too (the root domain for example).
Thank you! Will try this.
 
Back
Top