In general, you’d add a redirect rule to your .htaccess file: https://en.wikipedia.org/wiki/URL_redirection#Apache_mod_rewrite
However, there may be a better way depending on your situation.
Like, if you problem is that the installation is at /example
did you know that you can move it the main domain? https://codex.www.ads-software.com/Moving_WordPress#Moving_Directories_On_Your_Existing_Server
Or, if the installation is at the main domain, but you want a page at /example
to be the first thing people see, did you know that can easily make it so in the settings? https://codex.www.ads-software.com/Creating_a_Static_Front_Page