我有一个不解释 CSS 的网站。我已经看到了其他答案,但没有看到动态生成的 css 的答案。我通过添加在 PHP 中生成 CSS
<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">
我在 php 中的函数
public function render_css() {
header( 'Content-Type: text/css' );
// Aggressive caching to save future requests from the 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 );
}
这是我的 htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?tlldalil.wconsult.no$
RewriteRule ^(/)?$ ?page_id=23 [R=301,L]
order deny,allow
deny from all
allow from 88.89.104.103
allow from 93.50.99.14
###Start Kloxo PHP config Area
###Please Don't edit these comments or the content in between. kloxo uses this to recognize the lines it writes to the the file. If the above line is corrupted, it may fail to recognize them, leading to 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
我应该在我的 htaccess 中添加什么?