title: Why does setting headers to 200 OK give 404 Not Found with scraping tools?
body: <p>This is on an old PHP version, 5.2.17 that one of my web hosts has. The following code is verified to be executed on page load, before headers are sent:</p>
  
  <pre><code>header($_SERVER["SERVER_PROTOCOL"]." 200 OK");
  </code></pre>
  
  <p>However, using the Facebook Debugger and double-checking with <a href="https://www.internetmarketingninjas.com/header-checker/" rel="nofollow noreferrer">this alternative</a> gives a 404 error. Despite this, the page content is fetched and indexed OK by the scraper. Needless to say, I would like to not get a 404 reported to scrapers if the page loads correctly in all browsers, validates, and has correct headers.</p>
  
  <p>One example is <a href="http://coppershade.org/articles/Code/Tools/AsmTwo/" rel="nofollow noreferrer">this link</a>, which returns a 200, and</p>
  
  <p><a href="http://coppershade.org/articles/Code/Tools/AsmTwo" rel="nofollow noreferrer">the same URL (without trailing /)</a>, which returns a 404.</p>
  
  <p><strong>How do I accomodate SEF URLs with or without trailing slashes to be scraped correctly?</strong> Although I doubt this is the problem, since Wikipedia links have no trailing slashes and report 200 OK.</p>