Introduction
Sometimes, a website may redirect visitors to another URL, and the source of the redirect may not be immediately clear. In many cases, the redirect source can be identified through HTTP headers using the CURL command over SSH.
Prerequisites
- SSH access to the server
- CURL package installed on the server
- Basic knowledge of HTTP headers
Implementation
How to Find Common Redirect Sources
In some cases, you may notice a redirect on your domain name and may not know the source of the redirect.
This can often be identified by checking the website headers using the CURL command through SSH.
Step 1
Log in to the server via SSH.
Step 2
Run the following command:
curl -I yourdomainname.com
Step 3
After running the command, you may see output similar to the following:
[root@server ~]# curl -I yourdomain.com
HTTP/1.1 303 See Other
Date: Fri, 23 Jul 2021 05:04:24 GMT
Server: Apache
X-Redirect-By: WordPress
Content-Language: en
Location: https://yourdomain.com
Content-Type: text/html; charset=UTF-8
Step 4
In the above output, the important header is:
X-Redirect-By
This indicates the source of the redirection if the application provides it.
Common X-Redirect-By Headers
Some commonly used CMS applications display redirect information using the following headers:
X-Redirect-By: WordPress
X-Redirect-By: Joomla
X-Redirect-By: Moodle
Conclusion
Using the CURL command over SSH is a simple method to identify common website redirect sources. The X-Redirect-By header can help determine whether the redirect is generated by applications such as WordPress, Joomla, or Moodle.