- 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!
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!