How to determine ultimate website URLs after redirection?

When working with empirical data, you will often come across historical website URLs. The URLs may have been redirected to another site or location however.

In the process of determining canonical URLs, this sample will help you determine the actual ultimate URL redirect to. The table assumes you have a table bubs_leveranciers on an Oracle database with a URL stored in lvr_website_url. It returns all URLs that have been redirected using:

select lvr.lvr_id
,      lvr.lvr_website_url
,      htp.returned_url
from   bubs_leveranciers_v@ora lvr
join   HTTPDOWNLOAD@DataDictionary
       ( lvr.lvr_website_url
       , ignoreWebError => true
       ) htp
on     htp.returned_url = lvr.lvr_website_url
where  lvr.lvr_website_url is not null