You are here

function boost_htaccess_cache_dir_put in Boost 7

Same name and namespace in other branches
  1. 6 boost.module \boost_htaccess_cache_dir_put()

Overwrite old htaccess rules with new ones.

1 call to boost_htaccess_cache_dir_put()
boost_enable in ./boost.install
Implements hook_enable().
1 string reference to 'boost_htaccess_cache_dir_put'
boost_form_submit_handler in ./boost.module
Always run these functions after a form submit from boost.

File

./boost.module, line 1528
Caches generated output as a static file to be served directly from the webserver.

Code

function boost_htaccess_cache_dir_put() {
  global $_boost, $base_path, $base_root;
  if (empty($_boost['base_dir'])) {
    $url = $base_root . request_uri();
    $parts = parse_url($url);
    $_boost['base_dir'] = boost_get_normal_cache_dir() . '/' . $parts['host'] . $base_path;
  }
  boost_write_file($_boost['base_dir'] . '.htaccess', boost_htaccess_cache_dir_generate());
}