Where the domain redirects?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
14 views
Good time of day. With the command
curl -Is domain.com | head -n 1
can I check whether domain redirects somewhere or not (if it is 200 - OK, if you 301 - redirect).
But how do I bring the terminal to which it redirects, using BASH?
Sorry for the crooked question.
by | 14 views

2 Answers

0 like 0 dislike
I am in the same script use the following structure:
curl --connect-timeout 10-I -s-o /dev/null -w "%{http_code} %{url_effective}\==> %{redirect_url}\\" domain.com
by
0 like 0 dislike
wget itself is on redirecton and shows this:
wget domain.com 2018-04-27 --16:15:20-- http://domain.com/ Resolving domain.com (domain.com)... 13.228.112.135 Connecting to domain.com (domain.com)|13.228.112.135|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://domain.com/ [following] 2018-04-27 --16:15:21-- https://domain.com/ Connecting to domain.com (domain.com)|13.228.112.135|:443... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: https://www.domain.com/ [following] 2018-04-27 --16:15:23-- https://www.domain.com/ Resolving www.domain.com (www.domain.com)... 13.228.112.135 Connecting to www.domain.com (www.domain.com)|13.228.112.135|:443... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html’
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
6 answers
0 like 0 dislike
2 answers
asked Apr 11, 2019 by YaroslavKleyno
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
35,457 users