That's because you're probably handling css and javascript with relative paths.
Add a trailing slash to the beginning of the css and js includes. It will work that way:
<script src="/assets/js/demo.js"></script>
<link href="/assets/css/demo.min.css" rel="stylesheet">