3

Ok, so I am a little confused on how to get Google (and other search engines) to know about and index my website. The website is a simple front-end React App.

According to my research, it seems like these are the steps I must take:

  1. Create a sitemap.xml in the /public/index/ folder.
  2. Submit the sitemap.xml to Google here: Google Search Console
  3. And that is it?

So this is what I currently have:

I have my site hosted in AWS Amplify. If I navigate to my site's robots.txt file like this:

https://www.example.com/robots.txt

Then this is what the robots.txt file looks like:

# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:

So it's pretty empty. Is this OK? I have a feeling that file should have more info.

And this is my sitemap.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <url>
        <loc>https://example.com/</loc>
    </url>
    <url>
        <loc>https://example.com.com/blog/</loc>
    </url>
</urlset>

What do I need to do to get my site noticed by Google and other search engines?

mcool
  • 457
  • 4
  • 29
  • _The website is a simple front-end React App_ - Assuming it's a single page application (SPA), you might find this [question](https://stackoverflow.com/q/70390808) useful. – winwiz1 Feb 07 '22 at 07:09
  • It has multiple pages but if it were an SPA, would this change the way the site gets indexed? – mcool Feb 07 '22 at 15:03
  • Most SPAs have several pages. When browser requests SPA from webserver, it downloads the landing (index) page as .html file with script references. The scripts (React script bundles) are then downloaded and start running. When a user makes transitions to other (e.g. internal) SPA pages, it’s done by React code calling `history.push` API exposed by browser. Webserver is not aware of those page switches performed by client side code. So for a webserver it looks like there is only a single landing page. Hence the name ‘single page application’ or SPA. SPAs do have SEO peculiarities, see the link. – winwiz1 Feb 08 '22 at 07:06

0 Answers0