title: SEO in React based SPA
body: <p>I have a single page application built using React library (Create React App is used). And I have different routes inside the application which I am resolving using React Router, for instance <code>http://&lt;domain-name&gt;.com/faq</code>. Server side rendering is not used and right now I don't have a possibility to use it.</p>
  <p>I want inner pages of that application to be indexed by Google search engine. In order to do that I did the next things:</p>
  <ul>
  <li>Make inner pages (for instance <code>/faq</code> page) accessible via their routes</li>
  <li>Created <code>sitemap.xml</code> file inside <code>public</code> folder so that when the application is built Create React app puts this files into <code>/build</code> folder right after <code>index.html</code> file</li>
  </ul>
  <p>Sitemap file contains:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;urlset
    xmlns=&quot;http://www.sitemaps.org/schemas/sitemap/0.9&quot;
    xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
    xsi:schemaLocation=&quot;http://www.sitemaps.org/schemas/sitemap/0.9  
    http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd&quot;
  &gt;
    &lt;url&gt;
      &lt;loc&gt;https://www.&lt;domain-name&gt;.com&lt;/loc&gt;
      &lt;priority&gt;1&lt;/priority&gt;
    &lt;/url&gt;
  
    &lt;url&gt;
      &lt;loc&gt;https://www.&lt;domain-name&gt;.com/faq&lt;/loc&gt;
    &lt;/url&gt;
  &lt;/urlset&gt;
  </code></pre>
  <p>Where <code>&lt;domain-name&gt;</code> is a real domain name. I omited the rest of the pages here for the sake of simplicity.</p>
  <p>But unfortunately those pages are not being indexed by Google search engine even a week after I deployed this application. So I decided to use Google search console (<code>https://search.google.com/search-console/welcome</code>) and found that all of my inner pages are not found.</p>
  <p><a href="https://i.stack.imgur.com/UnhsNl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UnhsNl.png" alt="enter image description here" /></a></p>
  <p>So my question is how to make pages listed in the sitemap file to be indexed by Google search engine?</p>
  <p>NOTE: I am not sure if it's important or not, but when I open FAQ page in the browser and open Chrome dev tools, I see that there is a request to the document <code>/faq</code> and 404 response</p>
  <p><a href="https://i.stack.imgur.com/vjyS9l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vjyS9l.png" alt="enter image description here" /></a></p>