# HTML Question:  Get "DOCTYPE" as "strict" and do not want it to be

**URL:** <https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584>\
**Category:** Factual Questions\
**Created:** [June 23, 2011, 6:10pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584 "2011-06-23T18:10:49Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 23, 2011, 6:10pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/1 "2011-06-23T18:10:49Z")

</div>

When I go to my site: [http://www.marketswiki.com](http://www.marketswiki.com)

I see the following when I view the page’s source (View\>Page Source):

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd)”\>  
\<html lang=“en” dir=“ltr”\>

One of our web developers says the page is having problems displaying in Internet Explorer (not sure which versions) and has suggested it is the “STRICT” setting in there that is causing the problem.

If you go to: [Wikipedia, the free encyclopedia](http://en.wikipedia.org/wiki/Main_Page)

You get:

\<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”\>  
\<html lang=“en” dir=“ltr” xmlns=“[XHTML namespace](http://www.w3.org/1999/xhtml)”\>

Note in the above it says “Transitional”.

How do I change that?

What does that setting do?

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 23, 2011, 6:38pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/2 "2011-06-23T18:38:55Z")

</div>

To add:

Looks like this is a DTD (Document Type Definition). Not sure what that is though (despite some reading) or how to change it.

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [June 23, 2011, 6:43pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/3 "2011-06-23T18:43:19Z")

</div>

You appear to be running MediaWiki. Therefore you need to edit your configuration to change the value of the [$wgDocType](http://www.mediawiki.org/wiki/Manual:$wgDocType) variable. Exactly how you do this is highly dependent on your particular installation.

---

<div class="post-metadata">

**Author:** ![Duckster](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/duckster/32/1244_2.png) [@Duckster](https://boards.straightdope.com/u/Duckster)\
**Post date:** [June 23, 2011, 6:51pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/4 "2011-06-23T18:51:41Z")

</div>

> [@Whack-a-Mole](#):
>
> One of our web developers says the page is having problems displaying in Internet Explorer (not sure which versions) and has suggested it is the “STRICT” setting in there that is causing the problem.

Works just fine in IE 8. If your developer is using IE 7, that’s a problem because 7 was a crap IE browser to begin with.

Don’t write code using IE. Historically IE does not follow web standards so it often vomited, especially with the strict setting. IE 8 is a bit more stable.

Use Firefox, Opera or Chrome. Once you are assured is built to web standards (meaning it should work in the better Tier 1 browsers), then tackle any IE issues.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 23, 2011, 7:03pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/5 "2011-06-23T19:03:04Z")

</div>

> [@psychonaut](#):
>
> You appear to be running MediaWiki. Therefore you need to edit your configuration to change the value of the [$wgDocType](http://www.mediawiki.org/wiki/Manual:$wgDocType) variable. Exactly how you do this is highly dependent on your particular installation.

Thanks but I am unable to discern where that goes. Is it part of the skin I use? Part of LocalSettings?

I have Googled it and there is no suggestion as to where this is meant to be put.

---

<div class="post-metadata">

**Author:** ![ZipperJJ](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/zipperjj/32/211_2.png) [@ZipperJJ](https://boards.straightdope.com/u/ZipperJJ)\
**Post date:** [June 23, 2011, 7:05pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/6 "2011-06-23T19:05:59Z")

</div>

How about from [here](http://www.mediawiki.org/wiki/Manual:Configuration):

> [@](#):
>
> The main configuration files for the MediaWiki software are LocalSettings.php and AdminSettings.php.

Does that help?

---

<div class="post-metadata">

**Author:** ![psychonaut](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/psychonaut/32/4655_2.png) [@psychonaut](https://boards.straightdope.com/u/psychonaut)\
**Post date:** [June 23, 2011, 7:12pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/7 "2011-06-23T19:12:18Z")

</div>

> [@Whack-a-Mole](#):
>
> Thanks but I am unable to discern where that goes. Is it part of the skin I use? Part of LocalSettings?
> 
> I have Googled it and there is no suggestion as to where this is meant to be put.

Yes, it’s part of LocalSettings. However, without further information from you we can’t tell you exactly where you find LocalSettings or how to edit it, because this depends on where you installed MediaWiki, and on how you navigate there and launch an editor in your web server’s operating system.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 23, 2011, 7:19pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/8 "2011-06-23T19:19:27Z")

</div>

> [@psychonaut](#):
>
> Yes, it’s part of LocalSettings. However, without further information from you we can’t tell you exactly where you find LocalSettings or how to edit it, because this depends on where you installed MediaWiki, and on how you navigate there and launch an editor in your web server’s operating system.

I have access to LocalSettings. No problem there. I’ll give it a shot.

Thanks.

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 23, 2011, 9:56pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/9 "2011-06-23T21:56:48Z")

</div>

> [@psychonaut](#):
>
> Yes, it’s part of LocalSettings. However, without further information from you we can’t tell you exactly where you find LocalSettings or how to edit it, because this depends on where you installed MediaWiki, and on how you navigate there and launch an editor in your web server’s operating system.

Well, I put:

$wgDocType = “-//W3C//DTD XHTML 1.0 Transitional//EN”;  
$wgDTD = “[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)”;

In the LocalSettings.PHP file and nothing changed.

Back to the drawing board.

---

<div class="post-metadata">

**Author:** ![BigT](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bigt/32/12044_2.png) [@BigT](https://boards.straightdope.com/u/BigT)\
**Post date:** [June 23, 2011, 10:41pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/10 "2011-06-23T22:41:42Z")

</div>

If it’s IE6 or IE7, you’ll probably have to do some IE only hacks to the CSS.

---

<div class="post-metadata">

**Author:** ![MrSquishy](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@MrSquishy](https://boards.straightdope.com/u/MrSquishy)\
**Post date:** [June 24, 2011, 3:01am UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/11 "2011-06-24T03:01:45Z")

</div>

[http://www.mediawiki.org/wiki/Manual:$wgDocType](http://www.mediawiki.org/wiki/Manual:$wgDocType)

Is $wgHtml5 set to true? Seems unlikely.

It says Transitional is the default, what happens if you just comment out the $wgDocType setting?

---

<div class="post-metadata">

**Author:** ![MrSquishy](https://avatars.discourse-cdn.com/v4/letter/m/b9e5f3/32.png) [@MrSquishy](https://boards.straightdope.com/u/MrSquishy)\
**Post date:** [June 24, 2011, 3:07am UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/12 "2011-06-24T03:07:46Z")

</div>

Or does this help?

[http://forums.digitalpoint.com/showthread.php?t=1772984](http://forums.digitalpoint.com/showthread.php?t=1772984)

Maybe you’re editing the wrong copy of LocalSettings.php?

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 24, 2011, 3:32am UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/13 "2011-06-24T03:32:53Z")

</div>

> [@MrSquishy](#):
>
> [http://www.mediawiki.org/wiki/Manual:$wgDocType](http://www.mediawiki.org/wiki/Manual:$wgDocType)
> 
> Is $wgHtml5 set to true? Seems unlikely.
> 
> It says Transitional is the default, what happens if you just comment out the $wgDocType setting?

There was no $wgDocType setting at all in the LocalSettings file. When I added it nothing changed (although perhaps I got the syntax wrong).

> [@MrSquishy](#):
>
> Or does this help?
> 
> [http://forums.digitalpoint.com/showthread.php?t=1772984](http://forums.digitalpoint.com/showthread.php?t=1772984)
> 
> Maybe you’re editing the wrong copy of LocalSettings.php?

I definitely have the right file. I edit it on a semi-regular basis as I add extensions and stuff.

I ran a validate on XHTML (WC3 website has it) and used the verbose setting and it told me it was reading a \<!DOCTYPE !\> which specified the strict setting. Things is when I do a text search on every file in the Wiki it says there is no such string.

I host the site elsewhere and am guessing it is coming from their server. I contacted tech support there and they said they only help with this sort of problem if we have a fully managed (read lots more expensive) account. :rolleyes:

---

<div class="post-metadata">

**Author:** ![Whack-a-Mole](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whack-a-mole/32/141_2.png) [@Whack-a-Mole](https://boards.straightdope.com/u/Whack-a-Mole)\
**Post date:** [June 24, 2011, 9:46pm UTC](https://boards.straightdope.com/t/html-question-get-doctype-as-strict-and-do-not-want-it-to-be/586584/14 "2011-06-24T21:46:52Z")

</div>

I finally solved this.

What was not very apparent was I had to set html5 to be false to make the other doctype settings stick. It was mentioned upthread but I figured no setting meant it’d default to false (there was no $wgHtml5 setting listed at all). I dunno…all I know is that worked. I put the following in my LocalSettings file which did the trick:

/\*\* The HTML document type. \*/  
$wgHtml5 = false;  
$wgDocType = ‘-//W3C//DTD XHTML 1.0 Transitional//EN’;

/\*\* The URL of the document type declaration. \*/  
$wgDTD = ‘[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)’;

/\*\* The default xmlns attribute. \*/  
$wgXhtmlDefaultNamespace = ‘[XHTML namespace](http://www.w3.org/1999/xhtml)’;

Thanks for all the help!
