Replace $base_dir with global WEB_ROOT.