Symptom:

   When clicking on a URL for a Sharepoint site, the user gets an HTML 404 error. However, file/document access via OneDrive or File Explorer works fine. 


Problem:

   The default homepage for the SharePoint site is either deleted or reset.


Test:

  Add this to the end of the SharePoint URL in the web browser. 

/_layouts/15/viewlsts.aspx?view=14

Example:
https://goodwillni.sharepoint.com/sites/Transport/_layouts/15/viewlsts.aspx?view=14


If the site now comes up, the homepage default got reset.


Solution here:

404 error when accessing the SharePoint Online site. - Microsoft Community 


Dear Princy_Princy,

Thank you for your reply. For your description, it looks like the homepage is not set correctly. Kindly follow below steps for further actions.
1) Go to "site contents" page via URL directly. Then please go to site recycle bin, check if your previous home page(.aspx file) is deleted. If so, please restore it back.

2) In case you couldn't find back the original home page, please go to "site pages" and find a different page to make it home page. Right click the page > Make home page.

Image

Then please check if issue can be resolved.

Have a nice day!

Best Regards,

Sophia