Call (877) SITE-OPT (748-3678)

Code: Suture CSS or JavaScript files

From Chapter 6: Web Page Optimization

Here is how this digital surgery would work for CSS. You need to tell the server two things: first, to parse CSS files for PHP commands, and second, to send the correct MIME type. Add the following lines to your httpd.conf file for Apache:

AddHandler application/x-httpd-php .css
header('Content-type: text/css');

Next, you can merge your CSS files together with PHP inside the CSS file, like this:

<?php
    include("layout.css");
    include("navigation.css");
    include("advanced.css");
?>
Copyright © 2002-2017 Website Optimization, LLC. All Rights Reserved - Free website speed test - Privacy Policy
Last modified: February 19, 2009.

Follow us on: Twitter, Google+, Facebook, Linked In