Score:0

Redirecting all 404s to a custom page using Nginx $mod_rewrites

fr flag

How to redirect all 404s and any random characters after my domain all to the main domain? I'm using $mod_rewrites = [ code because .htaccess and other things are not working.

For Example :

From this https://example.com/any_character to https://example.com/

Codes I've used before and not working :

$mod_rewrites = [ '/$' => '/index.html'

$mod_rewrites = [ '/(.*)' => '/index.html'

But when I used a spesific subdirectory name, it works perfectly. For example :

$mod_rewrites = [ '/wp-admin' => '/index.html'

us flag
nginx does not have any `$mod_rewrites` concept. Please add full details of the environment.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.