Lets say I have "http://www.ritzcarlton.com" and that redirects me to "http://www.ritzcarlton.com/en/Default.htm". Is there a way in Perl to find the end url after all the redirects?
相关问题
- Stop .htaccess redirect with query string
- $ENV{$variable} in perl
- UrlEncodeUnicode and browser navigation errors
- Improve converting string to readable urls
- Is it possible to pass command-line arguments to @
相关文章
- How to get jQuery.ajax response status?
- send redirect and setting cookie, using laravel 5
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- Lazy (ungreedy) matching multiple groups using reg
- How do I tell DBD::mysql where mysql.sock is?
Using LWP will follow the redirections for you. You can then interrogate the
HTTP::Request
object to find out the URI it requested.Output is:
If you're issuing HTTP requests yourself, then the redirect URL will be in the returned
Location:
header. If you're using a proper HTTP client like LWP::UserAgent or WWW::Mechanize, which is what you should be doing, redirection is handled automatically.