How to respond 404 (not redirect to a page)


#1

Hi, I have been given a website that was hacked and setup for phishing.

All is well now (thanks to RS) but to clear the warnings, I must configure to send 404 when the naughty links are visited.

eg when visiting this
https://mtxelectronics.com/!+&.php/enterpassword.php
send back 404, not an empty page

the site is running on node.js, so I am currently looking at my react-router-dom plugin to see if it can trigger a server 404…

any pointers would be appreciated


#2

easiest way appears to be to change the rewrites rules.
With firebase hosting, the following will 404 on all routes not exactly /
(the default is “**”)

“rewrites”: [
{
“source”: “/”,
“destination”: “/index.html”
}
]


#3

Hi do you have seen this
https://firebase.google.com/docs/hosting/full-config


#4

Regarding hosting. Here’s a good basic tutorial for publishing PWA into Firebase hosting https://www.youtube.com/watch?v=rT-SwD2-8-4