'; $lines[] = 'RewriteEngine On'; $lines[] = 'RewriteBase /'; $lines[] = 'RewriteCond %{REQUEST_URI} ^' . $image_dir; $lines[] = 'RewriteCond %{REQUEST_FILENAME} !-f'; $lines[] = 'RewriteRule ^(.*)$ ' . $proxy_URL . '/$1 [P]'; $lines[] = ''; // Check the validity of the proxy URL if(preg_match('/.*:\/\/.*\..*\/.*\/.*\/.*\/.*/', $proxy_URL)) { addefend_log('ADDEFEND -- INFO : using '.$proxy_URL.' as the proxy URL'); $addefend_content_proxy = addefend_insert_with_markers($htaccess, ADDEFEND_HTACCESS_MARKER, $lines); if($addefend_content_proxy){ addefend_log('ADDEFEND -- TRACE : Rewrite rules inserted successfully'); }else{ addefend_log('ADDEFEND -- ERROR : Rewrite rules could not be inserted'); } } } function addefend_remove_rewrite_rules() { $htaccess = get_home_path().".htaccess"; insert_with_markers($htaccess, ADDEFEND_HTACCESS_MARKER,''); }