Putting back relative redirects

issue #1523

- also added some comments to indicate the difference between the two custom middleware files.