Why replacing the second part instead getting just the first one?

Update it to something like this:

    <script src="http://{{request.host.split(':')[0]}}:35729/livereload.js"></script>