fix preg_quote and path for outer url