0

When I am checking this page http://balrajsingh.in/blog/nar-aur-narayan in Google Page Insights. I found that there are a lot of reds. One of those is:

Avoid multiple redirects

But I have not created any redirects except a CNAME for www. to go to https://balrajsingh.in. I have created this blog in wordpress.

How can I resolve this?

enter image description here

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
paul
  • 4,333
  • 16
  • 71
  • 144
  • A CNAME is not a redirect. For the others, it appears you are linking to pages as `/blog` instead of `/blog/` or the other way around. WordPress will silently and quickly fix this, but a redirect still happens. – Chris Haas Sep 25 '21 at 12:27
  • Thanks! When you say `"you are linking"`, what do you mean by that? Because I strongly feel that I might have done it, unknowingly. I have a post category with slug "blog" and then a page "blog". I am new to WordPress. – paul Sep 25 '21 at 16:11
  • For the most part, WordPress (and most modern CMSs) know how to generate canonical links to themselves. In WordPress, this is especially true for thinks such as menus, pagination and taxonomies. When I say “you are linking”, I mean any time you as the theamer or content author are in charge. For instance, in footer.PHP you might have a manual link to the blog, or in a WYSIWYG editor you might have the same, and it is that URL that is getting redirected. – Chris Haas Sep 26 '21 at 23:57
  • Regardless of CMS, on Windows I use a tool called [Xenu](https://home.snafu.de/tilman/xenulink.html) and I turn in “treat redirections as errors”, and then look for any 301/302 on my site and fix. The program and site look shady, but I’ve been using them for a very, very long time. Others do similar, but I have no opinion of those. – Chris Haas Sep 27 '21 at 00:00
  • `301/302 on my site and fix` ... how do you fix? Do you know any plugin in WordPress that can fix? – paul Sep 27 '21 at 08:21
  • Plugins rarely fix problems in WordPress, they usually only patch the problem in the short term. I'd really encourage you to find your 301/302 redirects on your own and learn what the actual problem is. That said, this [plugin](https://wordpress.org/plugins/broken-link-checker/) does a pretty good job of finding and fixing redirects in general post content. Be careful of false positives and make sure to manually audit each and every fix before applying. – Chris Haas Sep 27 '21 at 13:33
  • 1
    I voted to close this question because it is not a programming question and it is off-topic on Stack Overflow. Non-programming questions about your website should be asked on [webmasters.se]. Please delete your question here and re-ask it there. – Stephen Ostermiller Nov 30 '21 at 10:58
  • How do you think this problem can be solved? Does coding in HTML, Java, Ruby, C#, Python languages, etc, only, called programming? – paul Dec 06 '21 at 10:31

1 Answers1

-1
RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$
RewriteRule ^https://www.%1%{REQUEST_URI} [NE,L,R=301]

use this
webCrewl
  • 9
  • 1