External style sheet link replaced with contents of style sheet


#1

I have tried google and the wiki, but did not find an explanation. In this simple page on Dreamhost, I specify the style sheet in cssTest.php with:

<?php
echo <<< EOF
<?xml version="1.0" encoding="UTF-8"?>
<!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">
   <head>
      <title>CSS external file test</title>
      <link type='text/css' rel='stylesheet' href='./styles.css' />
   </head>
   <body>
      <div class="page" id="page">
      </div>
   </body>
</html>
EOF
?>

The browser gets served:

<?xml version="1.0" encoding="UTF-8" ?>
<!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">
<head>
<title>CSS external file test</title>
<style>body{background-color:#fae8b0}
#banner{border-style:solid;border-width:medium;border-color:red}
#midPane{border-style:solid;border-width:medium;border-color:#000}
#footer{border-style:solid;border-width:medium;border-color:#00f}</style>
</head>
<body>
<div class="page" id="page">
</div>
</body>
</html>

First, the external link gets replaced with the style.
Second, the magic words “black” and “blue” in the style are replaced with hex equivalents.
While I do not think it is related, my .htaccess file in the web root contains:

AddHandler php5-cgi .html

Why are these replacements happening, and how can I stop them.


#2

This is one of the types of changes that Page Speed Optimization (mod_pagespeed) makes — small Javascript and CSS files are inlined into your page to save download time. Disable Page Speed Optimization (in the DreamHost Panel, under Manage Domains > Edit) if this behavior is undesirable.


#3

Thanks,

That was it. I shot myself in the foot when I turned on google analytics (a while ago). Thanks for the explanation, I might not have cared, but the substitution was causing a validation error. All better now!