             } else {
                 if let finalResult = response?.url {
                     if (finalResult.absoluteString == url.absoluteString) {
-                        self.workQueue.async {
-                            if !cancellable.isCancelled {
-                                completion(url)
+                        if response?.mimeType?.contains( "/html" ) ?? false {
+                            var request = URLRequest( url: url )
+                            request.addValue( "text/html,application/xhtml+xml,application/xml", forHTTPHeaderField: "Accept" )
+                            self.session.dataTask( with: request, completionHandler: { data, response, error in
+                                guard !cancellable.isCancelled
+                                else { return }
+
+                                if error != nil {
+                                    self.workQueue.async {
+                                        if !cancellable.isCancelled {
+                                            onError( .cannotBeOpened( "\(url.absoluteString): \(error.debugDescription)" ) )
+                                        }
+                                    }
+                                    return
+                                }
+
+                                if let response = response, let data = data {
+                                    let encoding = response.textEncodingName.flatMap {
+                                        String.Encoding( rawValue: CFStringConvertEncodingToNSStringEncoding(
+                                                CFStringConvertIANACharSetNameToEncoding( $0 as CFString ) ) )
+                                    } ?? .utf8
+                                    if let html = String( data: data, encoding: encoding ) {
+                                        for meta in Regex.pregMatchAll( html, regex: Regex.metatagPattern, index: 1 ) {
+                                            if (meta.contains( "http-equiv=\"refresh\"" ) || meta.contains( "http-equiv='refresh'" )),
+                                               let value = Regex.pregMatchFirst( meta, regex: Regex.metatagContentPattern, index: 2 )?.decoded.extendedTrim,
+                                               let redirectString = value.split( separator: ";" )
+                                                                         .first( where: { $0.lowercased().starts( with: "url=" ) } )?
+                                                                         .split( separator: "=", maxSplits: 1 ).last,
+                                               let redirectURL = URL( string: self.addImagePrefixIfNeeded( String( redirectString ), url: url ) ) {
+                                                self.unshortenURL( redirectURL, cancellable: cancellable, completion: completion, onError: onError )
+                                                return
+                                            }
+                                        }
+                                    }
+                                }
+
+                                self.workQueue.async {
+                                    if !cancellable.isCancelled {
+                                        completion( url )
+                                    }
+                                }
+                            } ).resume()
+                        }
+                        else {
+                            self.workQueue.async {
+                                if !cancellable.isCancelled {
+                                    completion( url )
+                                }
                             }
+                            task = nil
                         }
-                        task = nil
                     } else {
                         task?.cancel()
                         task = nil

    }

    // Add prefix image if needed
    fileprivate func addImagePrefixIfNeeded(_ image: String, result: Response) -> String {

        var image = image

        if let canonicalUrl = result.canonicalUrl, let finalUrl = result.finalUrl?.absoluteString {
            if finalUrl.hasPrefix("https:") {
                if image.hasPrefix("//") {
                    image = "https:" + image

        request.httpMethod = "HEAD"

        task = session.dataTask(with: request, completionHandler: { data, response, error in
            guard !cancellable.isCancelled
            else { return }

            if error != nil {
                self.workQueue.async {
                    if !cancellable.isCancelled {
