There are few things that you can checkbe several reasons why you are seeing this weird behavior. Some of them are listed below:
- Is it happening for all the pages? If yes, you need to check the sitedefinition.config
- Does the page have a Layout and rendering. If not, you need to make sure that the page has a valid layout and renderings associated so that it can be visible in front end.
- Is the item stuck in workflow and hence not published in web database? Move the item to the final workflow state and try browsing the URL.
- Is there any custom rendering due to which the page is breaking and redirecting to 404? Check the logs for any error related to your custom code. Try disabling renderings one by one and check if the page loads or not.