Forum Moderators: phranque

Message Too Old, No Replies

Redirect error for mail.example.com. What is this?

         

Tehuti

9:41 am on Sep 5, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Google Search Console is telling me that my site has a redirect error. This is the page:

https://mail.example.com

I did not create a 'mail' subdomain. I am assuming that it was created automatically for email-related reasons by cPanel.

Can anyone please tell me how I fix this error?

Do I redirect 'https://mail.example.com' to my homepage?

I'll be very grateful for some clear advice, as I can't find any online. :-)


[edited by: not2easy at 11:49 am (utc) on Sep 5, 2021]
[edit reason] please use example.com for readability [/edit]

not2easy

11:55 am on Sep 5, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



No, do not redirect the mail subdomain to your domain's home page. It is a normal configuration that you do not need to create, it exists to handle your domain's email. I would be curious as to how google followed a link to that URL. Can you find the request in your server logs?

phranque

10:46 pm on Sep 5, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



regardless of the pop3/smtp/imap server(s) that may or may not be using that hostname, the only relevant matter here is what happens when you make a web request for that hostname.
what is the response status chain when you make a request from this hostname?

somewhere in your web configuration (.htaccess file perhaps?) you should have implemented a canonical hostname redirect (using a 301) that would have avoided this.
(or perhaps an appropriate 4XX status code response for requests to non-canonical hostnames is preferred in some cases...)

Tehuti

12:35 pm on Dec 28, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thank you both very much for your replies, and apologies for not replying sooner!

This issue still exists. Search Console is still telling me that I have a redirect error and that the page is https://mail.example.com.

I just used an online tool to check the status of http://mail.example.com/ and it gave this result:

HTTP/2 301
location: https://mail.example.com/
content-length: 242
content-type: text/html; charset=iso-8859-1
date: Tue, 28 Dec 2021 12:28:45 GMT
server: Apache

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>Moved Permanently</h1> <p>The document has moved <a href="https://mail.example.com/">here</a>.</p> </body></html>

Does this mean I have a loop? How do I fix this issue?

Forgive my ignorance! I appreciate the geniuses who roam the forums on this website, where I have received help for so long.

lucy24

5:05 pm on Dec 28, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



GSC is more right than they know, because the very existence of a 301 response to this particular request is an error. I just tried it on one of mine at random, and got an immediate “unable to connect” response from the browser. That sounds right; it shouldn't be possible to make an HTTP request to mail.blahblah.

But unless it is your own server--which it doesn't sound like it is--the error is your host’s, not yours. Tell them to fix it.

In fact, what happens when you try to send mail to the domain in question?

phranque

8:56 pm on Dec 28, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I just used an online tool to check the status of http://mail.example.com/ and it gave this result:

HTTP/2 301
location: https://mail.example.com/
...
Does this mean I have a loop? How do I fix this issue?

yes, you have a recursive redirect.
you need to find the server configuration file (and perhaps the .htaccess file) for this hostname and determine which mod_rewrite directives are being fired for these requests.
(assuming this is an apache server)
is mail.example.com on the same IP address as www.example.com?

Can you find the request in your server logs?

looking in the web server access log file for the www.example.com site will give you a clue if they are on the same server.

it shouldn't be possible to make an HTTP request to mail.blahblah

some ISPs will provide a web portal for email using this hostname.
however a 301 to another hostname won't allow this to work.

I just tried it on one of mine at random, and got an immediate “unable to connect” response from the browser.

this isn't necessarily true in all cases. (see above)

what happens when you try to send mail to the domain in question?

while this might be academically interesting, it is irrelevant to the subject question.

Tehuti

10:06 pm on Dec 28, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thank you all for your replies, but, sorry, I still don't understand what the problem is and what I have to do. I just called Godaddy, and the lady didn't understand, either. She said I have to contact Google.

As you can tell, I am very ignorant when it comes to mod_rewrite-related stuff. It seems that cPanel has created this subdomain automatically for email purposes, and Google's crawler is accessing it and finding a loop. Is that correct?

If so, what do I do to fix it? Please forgive my ignorance!

phranque

2:43 am on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have you looked for clues in your web server access log file first?
that's where you should start.
if you don't see a request from your IP address that gets a 301 response then it is likely mail.example.com is a separate virtual host configuration from www.example.com

once you have discovered where the web server access log and file and web site root directory is located for the mail.example.com hostname, you can proceed.
you should be able to get this information from GoDaddy.
is there a file named .htaccess in the root directory of that hostname's file system?
you'll have to look for hidden files and you shouldn't normally be able to access this file with a browser.

you can try asking GoDaddy for the contents of the virtual host configuration for mail.example.com (or at least the mod_rewrite directives therein)

keep in mind that there may be a wildcard hostname configuration defined for *.example.com that would match any requests that aren't for a more specifically defined hostname (such as www.example.com or mail.example.com)

not2easy

3:37 am on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



I still don't understand what the problem is and what I have to do. I just called Godaddy, and the lady didn't understand, either. She said I have to contact Google.
The problem is that the 'page' that Google is telling you has a redirect error is not supposed to be a page. the .mail/ folder is supposed to be above the root directory where your site lives. It should not be accessible by bots and browsers. I am assuming that you did not set up that configuration so if you did not set it up and Google did not set it up, only your host can correct it.

As phranque suggests, look at your access logs to find the request for that 'page'. To make it easier, try to access that URL using your browser so you will have a specific date and time and IP in your logs to look for. That way you can see the server response recorded in your logs and also see where your browser takes you when that 'page' is requested.

The host is the only place to correct a problem such as having your .mail URLs open to Googlebots and reachable at a URL. First confirm the actual events in your raw access logs.

phranque

6:21 am on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



First confirm the actual events in your raw access logs.

specifically in the web server access log file configured for the mail.example.com hostname...

if you don't see the time/IP/URL/User-Agent record corresponding to your request in the access log, you are looking at the wrong file.

phranque

6:26 am on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the .mail/ folder is supposed to be above the root directory where your site lives. It should not be accessible by bots and browsers.

with the exception noted above, where the mail. subdomain (or webmail., etc) is often used as a hostname for the ISP's web interface to email.

Tehuti

12:28 pm on Dec 29, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thank you for the continued help, phranque and not2easy!

Here are the contents of my .htaccess file:

# BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.15]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# BEGIN old page redirects
<IfModule mod_rewrite.c>
RewriteEngine On
[bunch of 301 redirects that I set up. None of them concern 'mail.example.com/']
</IfModule>
# END old page redirects
# BEGIN LiteSpeed
<IfModule Litespeed>
SetEnv noabort 1
</IfModule>
# END LiteSpeed

Can you see any issues?

I phoned Godaddy again. Once again, they told me to get in contact with Google.

I checked my cPanel error logs. I have quite a few errors. However, when Godaddy checked my cPanel error logs, they couldn't see any!

I don't think the cPanel error logs are related to this Search Console 301 redirect error. They all either say "Cannot serve directory" or "Client denied by server configuration".


[edited by: not2easy at 5:24 pm (utc) on Dec 29, 2021]
[edit reason] unlinked for readability [/edit]

not2easy

1:05 pm on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Your CPanel error logs are not where you should be looking. You should be able to download a raw access log that shows every request and response from the server for your domain. Ask your host how to download your access logs. That is the place to see what is actually happening when a file is requested and how the server is responding to the request.

I'd need more time to sort through the rules but from first glance I can see that your https rule is not where it will properly handle requests. Be wary of using cPanel for rewrite rules because it will only do what you tell it to and does not correct any mistakes that might result from putting rules in the wrong order or improperly created. That "bunch of 301 redirects" you mention should be before (above) the rules that set https for example.

lucy24

5:05 pm on Dec 29, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Even before looking at access logs: What happens when you yourself in your browser request mail.example.com?

"Client denied by server configuration"
That's error-log-speak for “the request received a 403 response”. (No matter what logging level is set, there will never be any more information.) In general, when studying your error logs it’s easiest to delete all these lines and look at what's left, if anything.

Tehuti

6:37 pm on Dec 29, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



When I go to mail.example.com, first, Chrome warns me that the page is unsafe. When I choose to go there anyway, I land on a page that says this:

This page isn’t working
mail.example.com redirected you too many times.
Try clearing your cookies.
ERR_TOO_MANY_REDIRECTS

I managed to download my logs for December. There is no mention in there of mail.example.com.

not2easy

7:14 pm on Dec 29, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



There is no mention in there of mail.example.com.
That is why it was suggested that you try the URL, noting the time you tried it and then download the logs. Your most recent entry may not be included - you look at the server timestamp for the last entry in your logs and it is possible to see it is not showing the most recent activity. I have known hosts who keep a daily log separate and add it in once a day to the .zip access logs you can download. Some hosts offer a way to let you select the log version you are hoping to look at. GoDaddy? I have no clue about their log practices, sorry.

Do you paste this URL:
https://mail.example.com 
in your browser's address bar to test the URL? When you look at your access logs, what is the most recent timestamp shown? when you know the server's location you may need to adjust their timestamp to your timezone for any relative accuracy. This depends on whether you have adjusted the server time to your own timezone - it normally shows the time where the server is located.

Tehuti

1:01 pm on Dec 30, 2021 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thank you for the reply, not2easy.

"That is why it was suggested that you try the URL, noting the time you tried it and then download the logs. Your most recent entry may not be included"

Search Console shows that the redirect error's happening every day, going back months, so it should be in the December log. There's no mention of mail.example.com in the log.

not2easy

1:19 pm on Dec 30, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Do you find your IP for your request in the log? You should be able to find each request whether it was for your site's pages or for the images and .css files for the pages.

lucy24

4:59 pm on Dec 30, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's no mention of mail.example.com in the log.
This strikes me as a red herring. Apache access logs don't ordinarily show the hostname, only the response code.

In your browser, turn on a utility like Live Headers. Now you can see exactly what you're being redirected to.

Incidentally, the original question can alternatively be answered by: “At least 9 times out of 10, problems reported in GSC can safely be ignored.”

phranque

9:46 am on Jan 1, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



until you have determined that your request for mail.example.com is using the same document root directory as the .htaccess file containing these directives, it is a waste of time to discuss these directives.

When I go to mail.example.com, first, Chrome warns me that the page is unsafe.

are you requesting http://mail.example.com/ or https://mail.example.com/ ?

There is no mention in there of mail.example.com.

how about a record containing your IP and your User Agent string and the time of your request?