Resource interpreted as Stylesheet but transferred with MIME type text/html with css generated in PHP -
i have site css not interpreted. i've seen other answers not 1 dinamically generated css. i'm generating css in php adding
<link media="all" type="text/css" href="http://tylldalil.wconsult.no/?ai1ec_render_css=1367403986&ver=3.5.1" id="ai1ec_stytle-css" rel="stylesheet">
my function in php
public function render_css() { header( 'content-type: text/css' ); // aggressive caching save future requests same client. $etag = '"' . md5( __file__ . $_get[self::get_varibale_name] ) . '"'; header( 'etag: ' . $etag ); $max_age = 31536000; header( 'expires: ' . gmdate( 'd, d m y h:i:s', ai1ec_time_utility::current_time() + $max_age ) . ' gmt' ); header( 'cache-control: public, max-age=' . $max_age ); if ( empty( $_server['http_if_none_match'] ) || $etag !== stripslashes( $_server['http_if_none_match'] ) ) { // compress data if possible if ( extension_loaded( 'zlib' ) ) { // ob_start( 'ob_gzhandler' ); } $content = $this->get_compiled_css(); echo $content; ob_end_flush(); } else { // not modified! status_header( 304 ); } // we're done! exit( 0 ); }
this htaccess
rewriteengine on rewritecond %{http_host} ^(www.)?tlldalil.wconsult.no$ rewriterule ^(/)?$ ?page_id=23 [r=301,l] order deny,allow deny allow 88.89.104.103 allow 93.50.99.14 ###start kloxo php config area ###please don't edit these comments or content in between. kloxo uses recognize lines writes the file. if above line corrupted, may fail recognize them, leading multiple lines. <ifmodule mod_php4.c> php_value error_log "/home/klausen/__processed_stats/tylldalil.wconsult.no.phplog" php_value upload_max_filesize 64m php_value max_execution_time 60 php_value max_input_time 120 php_value memory_limit 64m php_value post_max_size 64m php_flag register_globals off php_flag display_errors off php_flag file_uploads on php_flag log_errors off php_flag output_buffering off php_flag register_argc_argv on php_flag magic_quotes_gpc off php_flag magic_quotes_runtime off php_flag magic_quotes_sybase off php_flag mysql.allow_persistent off php_flag register_long_arrays on php_flag allow_url_fopen on php_flag cgi.force_redirect on php_flag enable_dl on </ifmodule> <ifmodule mod_php5.c> php_value error_log "/home/klausen/__processed_stats/tylldalil.wconsult.no.phplog" php_value upload_max_filesize 64m php_value max_execution_time 60 php_value max_input_time 120 php_value memory_limit 64m php_value post_max_size 64m php_flag register_globals off php_flag display_errors off php_flag file_uploads on php_flag log_errors off php_flag output_buffering off php_flag register_argc_argv on php_flag magic_quotes_gpc off php_flag magic_quotes_runtime off php_flag magic_quotes_sybase off php_flag mysql.allow_persistent off php_flag register_long_arrays on php_flag allow_url_fopen on php_flag cgi.force_redirect on php_flag enable_dl on </ifmodule> ###end kloxo php config area # begin wordpress # end wordpress
what should add htaccess?
when try view css, "apache 2 test page powered centos" html page instead. page response headers declare "403 forbidden".
could connected aggressive caching?
what happens if, in php, amend line:
$etag = '"' . md5( __file__ . $_get[self::get_varibale_name] ) . '"';
to
$etag = '"' . md5( __file__ . $_get[self::get_variable_name] ) . '"';
?
Comments
Post a Comment