Cannot get _redirects file to direct any invalid URLs back the homepage

I have looked at a number of articles and tried to create a _redirect file to simply do the following…

Let’s say my site is domain.com, that is currently the only URL people need to go to because it’s currently a single page site. However, this site has been hosted elsewhere before and has a lot of links around with domain.com/sub-directory etc and these directories don’t exist anymore so any URL that is not simple my domain.com should get redirected to this via a 404, what would I need to put into the _redirects file to achieve this?

Thanks in advance :slight_smile:

Welcome @ljosys!

Check these docs:

Thanks for replying @andylemaire. I have checked this and tried to replicate the suggestions on this page but still no luck. I literally want to just traffic any URLs that do not point to an existing static page to the home page. But the examples I could see for /en/ and /de/ do not make sense to me. I don’t have different regional content, just the homepage which is literally just the domain name. Can you advise on the right content for my site? I don’t want a 404, but just to redirect to homepage.

I think this is what you need then:

/* / 404