This piece is not very efficient (memory wise) and may miss out some urls (HTTPS and more than one per line).

```python
re.sub(r'https?://.*?/{0}/'.format(CFG_SITE_RECORD),
       '{0}/{1}/'.format(CFG_SITE_URL, CFG_SITE_RECORD),
       line)
```

also concatenation might not be the best fit for big strings.