I am using the Pathauto module for creating user-friendly and SEO-friendly URLs. Therefore, I do not want and there is no need that the "old URL" like mydomain.com/node/1 or mydomain.com/node/4 is any longer public. So, how do I hide this and make only the path aliases public?
You need to create patterns for pathauto and go back to those nodes and save them, ensuring “generate new alias” is checked off on the node form.
I solved the problem using the Redirect Module. It comes with three modules. I enable the Redirect Module and the Redirect Domain Module. Then I create in tab Domain Redirect a redirect from subdomain /node/* to front-page (using alias of front-page). It works and this solution is ok for me.