0

I'd like to ask that how can I config to ignore some specific urls from serving index.html file in React App.

I know that there was a rule that fallback to index.html if the url is not found (Similar -s option in serve command). But I want to ignore some url so that if the url is not found, it will respond as Not Found instead of serving index.html file.

For example: If I set to ignore some urls

{
   "ignoreUrls": ["/favicon.ico", "/apple-touch-icon.ico"]
}

So if I navigate to "/favicon.ico", if it does not have that file, it will respond as 404 Not found. The real case is that my favicon is not in root public folder, it's in /favicons folder. But I want that if you're going to find /favicon.ico in root, it should respond 404 Not Found

Quoc Van Tang
  • 1,075
  • 4
  • 15
  • 33

1 Answers1

1

Just set it to "/favicons/favicon.ico". In your case:

{
   "ignoreUrls": ["/favicons/favicon.ico", "/favicons/apple-touch-icon.ico"]
}
Sid110307
  • 497
  • 2
  • 8
  • 22