# Bad value X for attribute “href” on element “a”: Unexpected slash or backslash.

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-x-for-attribute-href-on-element-a-unexpected-slash-or-backslash
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The URL in this `href` has a slash or backslash where the parser did not expect one, usually too many slashes after the scheme or a backslash standing in for the `//` separator.

After a scheme like `https:` the URL syntax expects exactly two forward slashes before the host: `https://example.com`. Adding a third slash (`https:///example.com`) leaves an empty host, and writing the separator with backslashes (`https:\\example.com`) uses a character the URL grammar does not allow there. In both cases the validator reports an unexpected slash or backslash.

This often comes from string concatenation that joins a base URL already ending in `/` with a path that also starts with `/`, or from copying a path that used backslashes. Browsers may paper over some of these, but the link can still resolve to the wrong place or fail in non-browser clients.

## Invalid example

```html
<a href="https:///example.com/page">Visit the page</a>
```

## Valid example

```html
<a href="https://example.com/page">Visit the page</a>
```

Keep exactly two forward slashes after the scheme, and use forward slashes throughout the URL.
