How To Redirect Home Page Url To Other Page Or All 404 To Home Page?


My question is that if I want to redirect my home page to another page by redirecting 301, then how can I do that, will you explain to me by writing the complete code?

Like = [ ] Redirect To [ ]

And my second question is that I want to redirect every single error page to the home page, so how can I do that means I can redirect every 404 to the home page, you will also explain to me by writing the complete code.

Like = [ DOMAIN.COM/abcdfg ] Redirect To [ Domain.Com/ ]
Like = [ DOMAIN.COM/zzghag ] Redirect To [ Domain.Com/ ]

If you answer both of my questions, I will be very grateful to you, by the way, my website is a simple HTML static, thank you for reading the message, now if you know the answer, then definitely reply.

thank you even more

Have you looked over the Redirects documentation yet?

To redirect the domain root to something like /en/ would look like

/    /en    301!

The ! forces the redirect even if there is content at that location.

As far as I can gather from documentation and testing, it is not possible to redirect any non-existent path to the domain root.

If you want to have every non-existent page show the homepage

/*    /index.html    404

This won’t redirect, but will show the homepage with a 404 status. If you have a 404.html page as part of the deploy, it will show that. This is why the 404 Not Found status code exists.

If you had a specific route that you wanted to redirect to the domain root (homepage) or other location you would add

/old-page    /new-page    301
/no-page-here    /    301

I Love You Buddy Thanks You So So Much :slight_smile: