I have been struggling for a few weeks with an issue that I am unable to fix, and I am not getting what to do now. In Google Search Console
, Assume page with a redirect error
for my website https://example.com
.
http://example.com
http://www.example.com
https://www.example.com
I can understand these redirect errors because in my .htaccess
file, I redirect users from HTTP to HTTPS and from www to non-www, i.e., https://example.com
. My .htaccess
file code is written below:
# BEGIN LSCACHE
# END LSCACHE
# BEGIN NON_LSCACHE
# END NON_LSCACHE
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.example.com/
RewriteRule (.*) https://example.com/$1 [R 301,L]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
My WordPress settings are set to https://example.com
my links in the XML sitemap
use https
. I inserted the below code snippet in the .htaccess
file after code RewriteEngine On
for redirecting to non-www
and https
versions of the website and started new validation, google validation failed thrice. I still have not gotten a fix for the page with the redirect error appearing in the Google search console under the page indexing section.
RewriteCond %{HTTP_HOST} ^www.example.com/
RewriteRule (.*) https://example.com/$1 [R 301,L]
How to fix this error?
Further, I came to know that this is not an error. This is information for you in the
Google search console
to let you know that the mentioned pages in the screenshot start with (http
,http://www
,https://www
) for the website is being redirected to another URL so that you can verify that the redirect is correct which is done as per plan. You only have to care about your target page; please check if your target page, which ishttps://example.com
, is indexed or not.If your target page is indexed, then you can ignore this
redirect error
in theGoogle search console
, i.e. your audience will always see the targethttps
version of the page.Type the below command in Google search and press Enter to confirm whether your target page is indexed or not.
site:https://example.com