Due to moving of a site, the old hoster created a redirect to the new location. However, there is a leading slash `/` in the redirection and the former hoster is not able/willing to fix it. So I end up with all the redirects coming in like this:

`http://sub.domain.com//path/to/file.html`

So I tried to remove the leading slash:

* using `mod_alias`

```
RedirectMatch 301 ^//(.*)$ http://sub.domain.com/$1

```
* using `mod_rewrite`

```
RewriteEngine on
RewriteCond %{REQUEST_METHOD}  !=POST
RewriteCond %{REQUEST_URI} ^(.*?)(/{2,})(.*)$
RewriteRule . %1/%3 [R=301,L]

```

Neither works. The latter removes multiple slashes inside the path, but not at the beginning.

There are already questions regarding slash removing, but they don't solve this problem:

* [Issue In Removing Double Or More Slashes From URL By .htaccess](https://stackoverflow.com/questions/17080652/issue-in-removing-double-or-more-slashes-from-url-by-htaccess)
* [.htaccess - how to remove repeated characters from url?](https://stackoverflow.com/questions/19439437/htaccess-how-to-remove-repeated-characters-from-url/19472215#19472215)

Does Apache somehow treat this case differently?

How do I get rid of one of the leading slashes?