2

I am having a few problems with Google search console not validating any of my self hosted WordPress blog pages and I have tracked it down to (I think!) a redirect from HTTP to HTTPS.

This is my .htaccess code.

Options +FollowSymLinks

RewriteEngine on
RewriteRule (.*)$ "http\:\/\/blog\.pet\-portraitartist\.com\/$1" [R=301,L]

But I have read on the forum:

If you have access to .htaccess, then rewrite the HTTP pages to HTTPS. Put in a canonical tag that points to HTTPS

I do have access to my .htaccess file but I have no clue how to write this correctly and make it work to validate my pages.

6
  • What does "not validating" mean? I've never seen GSC complain about pages not being valid. Can you share the full message you are getting? Dec 6, 2023 at 13:10
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Dec 6, 2023 at 13:30
  • I can add more info, the email is as follows 'Some fixes failed for Page indexing. You requested that Google validate your fix of Page indexing issues. The fix requested was for the following issue: 'Page with redirect'. When you go to the console, it says that all 341 pages have a redirect and are not validated. When you test the URL it does say they are on Google and there are no issues. On searching the issue I realised that in the URL, when I click the link to the blog, it goes from HTTP to HTTPS so therefore is a redirect. The advice I found was to change my blog HTaccess file. Dec 6, 2023 at 13:58
  • "This is my .htaccess code." - Where exactly is that code? Where is that .htaccess file? That rule is effectively a Site-A to Site-B type redirect (and it is redirecting to HTTP, not HTTPS - which is certainly wrong). However, having had a quick look at your site, it appears to be redirecting correctly. The blog subdomain is a WordPress site and this appears to be redirected by WordPress itself (which is "OK"). The rest of the site is outside of WordPress (perhaps a static HTML site?). And this site is also redirected OK, by Apache(?) - so you seem to already have the redirect somewhere?
    – MrWhite
    Dec 7, 2023 at 2:50
  • "This is my .htaccess code" - Incidentally, that is not the .htaccess file that is driving your WordPress "blog".
    – MrWhite
    Dec 7, 2023 at 2:51

1 Answer 1

0

This should be able to redirect your non-https traffic to https.

Following resource at https://www.freecodecamp.org/news/how-to-redirect-http-to-https-using-htaccess can be more helpful.


RewriteCond %{HTTP_HOST} ^www\. [NC,OR]
RewriteCond %{HTTPS} !=on
RewriteRule ^  https://example.com%{REQUEST_URI} [L,R=301]```
2
  • 2
    This is also a www to non-www redirect. The OP appears to be using a blog subdomain. However, if this is a WordPress site (as stated) then you also have to be mindful of where you put this "redirect" in the .htaccess file.
    – MrWhite
    Dec 7, 2023 at 2:55
  • 1
    Thank you John! Thank you for your helpful reply! Dec 7, 2023 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.