# Bad value “https://www.w3.org/1999/xhtml” for the attribute “xmlns” (only “http://www.w3.org/1999/xhtml” permitted here).

> Canonical HTML version: https://rocketvalidator.com/html-validation/bad-value-https-www-w3-org-1999-xhtml-for-the-attribute-xmlns-only-http-www-w3-org-1999-xhtml-permitted-here
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

The `xmlns` attribute has the XHTML namespace written with `https://`, but the only allowed value is `http://www.w3.org/1999/xhtml`.

A namespace name looks like a web address, yet no browser ever loads it. Parsers treat it as a fixed name and compare it character by character, so `https://www.w3.org/1999/xhtml` names a different namespace than the HTML one. The `https` usually slips in when a site moves to HTTPS. A search and replace across the templates, or a plugin that upgrades every `http://` string, changes the namespace along with the real links. The SVG and MathML namespaces keep `http://` too.

In a page served as `text/html`, the parser puts every element in the HTML namespace by itself, and the HTML standard says `xmlns` has no effect there, which is why the page still renders. The value matters once the same markup is parsed as XML, for example when it's served as `application/xhtml+xml` or run through XSLT. Its elements then land in an unknown namespace, and browsers and XML tools no longer treat them as HTML.

Change `https` back to `http`. In a page served as HTML you can delete the attribute instead, and keep it only if the same file also has to work as XHTML. If an HTTPS rewrite caused the change, exclude namespace names from it so the next run doesn't break them again.

## Invalid example

```html
<!DOCTYPE html>
<html xmlns="https://www.w3.org/1999/xhtml" lang="en">
  <head>
    <title>Products</title>
  </head>
  <body>
    <p>Our product range.</p>
  </body>
</html>
```

## Valid example

```html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <title>Products</title>
  </head>
  <body>
    <p>Our product range.</p>
  </body>
</html>
```
