Reputation: 26167
Why is W3C telling me I have no doctype set for my pages (in particular the home page)? My home page is using the 1column.phtml, which has a valid doctype (see below), and you can see it when you view the source in the browser. The w3c markup validation service is telling me there is no set doctype, why?!
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Our development site is showing a valid doctype.. and I've even tried taking the 1column.phtml (root) template from there and replace the live one and still nothing. I'm at a total loss of what the issue is.
Upvotes: 0
Views: 670
Reputation: 82986
The first 8 lines of the home page as is being sent to the validator precede the doctype and say:
Strict Standards: Aitoc_Aitpagecache_Mobile_Detect::__construct() [aitoc-aitpagecache-mobile-detect.--construct]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/goorins/public_html/lib/Aitpagecache/Mobile/Detect.php on line 42
Notice: Undefined index: HTTP_ACCEPT in /home/goorins/public_html/lib/Aitpagecache/Mobile/Detect.php on line 42
Strict Standards: setcookie() [function.setcookie]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/goorins/public_html/lib/Aitpagecache/Mainpage.php on line 172
Warning: Cannot modify header information - headers already sent by (output started at /home/goorins/public_html/lib/Aitpagecache/Mobile/Detect.php:42) in /home/goorins/public_html/lib/Aitpagecache/Mainpage.php on line 172
Which appears to be coming from an AITOC magento plug-in. Means little to me (PHP/apache/magento is not my thing), but it looks to be that Mobile/Detect.php line 42 assumes that there will be an HTTP "accept" header to process. The HTML validator does not send a HTTP "accept" header, so an error is occuring which is reported at the top of the output page. It may be that because it is reporting the error, it also reports the warnings about a misconfiguration of the timezone settings.
Upvotes: 1
Reputation: 166066
Hard to say for certain without an in-depth debugging session, but my guess is it's the lack of any character encoding being sent back with your browser headers.
$ curl -I https://www.goorin.com/
HTTP/1.1 200 OK
Date: Tue, 23 Oct 2012 01:04:50 GMT
Server: LiteSpeed
Connection: close
Set-Cookie: frontend=7dcc17b985ecd8983ff6ade10e0f6f2c; expires=Tue, 23-Oct-2012 02:04:50 GMT; path=/; domain=..www.goorin.com; httponly
Set-Cookie: frontend=7dcc17b985ecd8983ff6ade10e0f6f2c; expires=Tue, 23-Oct-2012 02:04:50 GMT; path=/; domain=..www.goorin.com; httponly
Content-Type: text/html
which somehow causes the character encoding to get munged, and the validator no longer recognizes it.
Try downloading your home page with curl
curl -I https://www.goorin.com/ > home.html
and then using the W3C file upload validation service (the "Validate by File Upload" tab). When I did this, the validator stopped complaining about your DOCTYPE
.
So, even if it's not the lack of character encoding in your headers, this points to the problem being the delivery of the HTML document from your server to the validator service.
Upvotes: 0