How to change relative path in hyperlinks?
You may need to:


Check the setting for RewriteBase in .htaccess (e.g make RewriteBase /)
Check the $base_url setting is correct (Should be automatic in D8).
Clear all caches ( Admin > Config > Development > Performance > Clear cache )


If you have inline links in body content with incorrect URLs, that's a different story, but the above may help with the standard stuff.