AWS Lightsail Wordpress IP address indexed by google

0

Hi there,

I have an issue as Google has indexed my website address and IP too and its my IP address also showing backlinks in my google search console.

I have made the following change in the .htaccess file to add a 403 rewrite for the ip address: but still its unsolved what should I do?

RewriteEngine On

Redirect from HTTP to HTTPS

RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301]

RewriteEngine On RewriteCond %{REMOTE_ADDR} ^00.000.000.00$ RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

asked 8 months ago375 views
2 Answers
0

To prevent search crawlers such as Google from indexing your site, you can create a robots.txt file in your web root

For example, this will inform all crawlers not to index your website

User-agent: *
Disallow: /

You can also change your WordPress Privacy settings as per Optimize Your Site for Search Engines (SEO)

https://en-support.files.wordpress.com/2023/08/privacy-settings-public.png?w=1024

AWS
EXPERT
Mike_L
answered 8 months ago
  • The proposed robots.txt would also be served from the public name of the wordpress site, making your answer as given non-functional. Furthermore, Google is extremely bad at obeying robots.txt, so even if the OP had a mechanism to serve a different robots.txt for IP-only URLs, it might not work.

0

From my experience, three countermeasures are all needed:

  1. Add a WordPress plugin or custom theme code to change the canonical URL link element in the HTML headers of all pages such as: "<link rel='canonical' href='blog.domain.tld/actual/url/here' />" Note that the "type" attribute is omitted due to a bug in some versions of Google. In some versions of WordPress, the predefined rel_canonical action does this slightly wrong hence the need for code to override it.

  2. Change the web server configuration to include the right domain name in a canonical URL HTTP Link header for non-html files such as 'Link: https://blog.domain.tld/actual/url/here.png; rel="canonical">' Instructions depend on the web server software.

  3. Contact the sites that link to your IP address and tell them to link to the right domain name instead.

answered 7 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions