You can use the <wbr> HTML element. It specifies a "word break opportunity", meaning it will break at that point only if needed (e.g., on small screens).
So in your example you could do something such as:
<p>http://www.example.com/<wbr>mylongpagename</p>