Re-writing static website in angular 6. Will default 404 route hurt SEO?

by Scott Clark   Last Updated June 19, 2018 15:04 PM - source

Lets say our previous was a word press app with links like site.com/about-us that served up static pages.

Well now out app is an Angular 6 SPA being served in IIS through azure. Right now to solve broken links on search results that have the old site cached we are using the default catch-all angular 404 technique.

  {
    path: '404', component: Error404Component
  },
  {
    path: '**', redirectTo: '404'
  }

I'm worried that since all of these dead links on search results now return a status 200 instead of a status 404 that google and bing will think these are still valid links and never update them. Even worse is that the IIS web.config code to make angular routes work on refresh / direct navigation:

<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
        <match url=".*"/>
        <conditions logicalGrouping="MatchAll">
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
        <add input="{REQUEST_URI}" pattern="^/(api)" negate="true" />
        </conditions>
        <action type="Rewrite" url="/"/>
    </rule>
</rules>
</rewrite>

also prevents 404 codes from being sent back in the http headers since it still served index.html/root and its the angular router that crashes. Is this a valid concern?



Related Questions



Configure redirects with web.config

Updated April 03, 2019 18:04 PM

How to convert a .htaccess to web.config?

Updated September 24, 2019 19:04 PM


Change permanent redirect from HTTP to HTTPS

Updated August 01, 2019 11:04 AM