Check 301 http response with curl

You can dump the headers of the response with the -D option:

curl -s -D - http://www.example.com -o /dev/null

Response:

HTTP/1.1 301 Moved Permanently
Date: Fri, 07 Oct 2016 07:50:51 GMT
Server: Apache/2.4.10 (Debian)
Location: https://www.newexample.com/
Content-Length: 309
Content-Type: text/html; charset=iso-8859-1

-s is for Silent mode (don't output anything)

  • 0 משתמשים שמצאו מאמר זה מועיל
?האם התשובה שקיבלתם הייתה מועילה

מאמרים קשורים

How To: Back Up MySQL Databases From The Command Line

While automated backups are important, sometimes you just want to take a quick and dirty snapshot...

How To Install MariaDB on CentOS 6

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and...

How to Display (List) All Jobs in Cron / Crontab

View Root’s Cron Jobs crontab -l  View a User’s Cron Jobs crontab -u username -l Example with...

How To: Automate Server Scripts With Cron

Servers can automatically perform tasks that you would otherwise have to perform yourself, such...

How to find sending spam emails and enable mail header in php.ini

- In Linux servers if there are a lot of emails in the queue "over 100" emails. you can check if...