Well, that depends on the type of redirect...
There are two types of redirects, ones that are handled by the server (header response) and those handled by the users browser.
Header Redirects
Header redirects are handled by the server and therefore no information other than the instruction to forward the user from one location to another is passed - in other words, crawlers and users do not see any previous information from any other page apart from the final destination.
Examples of common header redirects are:
- htaccess:
Redirect 301 / http://www.example.com/new-url/
- Nginx redirect:
Return 301 $scheme://www.example.com/new-url/;
- Lighttpd:
url.redirect = ( "" => "http://www.example.com/new-url/")
- PHP:
header('Location: http://www.example.com/new-url/');
User Browser Redirects
These redirects are handled by the browser, client or crawler, and both the start and destination source code are viewable.
These types of directions look something like this:
- Meta Refresh
<meta http-equiv="refresh" content="0; URL='http://www.example.com/new-url/'" />
- JavaScript:
window.location = "http://www.example.com/new-url/";
Summary
Browsers, clients and crawlers do not see any previous page contents when the website is using a header redirect. This includes the contents of <html>
<head>
<body>
and any other information included on the page such as meta descriptions and page titles.
So, essentially, your new page must have everything you want crawlers and users to see, no information is passed from old, to new, under a header redirect. Of course you could use PHP to populate the meta description and title, from a previous SQL entry or document, but that's not something I will include or give any direction on in this answer as it would be out of SCOPE.
But don't just take my word for it, give it a try yourself, using CURL.
Use a Linux Shell or if you use Windows simply download Ubuntu from the Microsoft Store.
- CURL on the final destination:
curl https://www.example.com/new-url/ > new-url.html
- CURL on old URL
curl https://www.example.com/old-url/ > old-url.html
Then using your favourite shell viewer/editor, in my case pico, pico old-url.html
and pico new-url.html
, you will notice, the new one is populated, the old one is empty. What curl sees, is what crawlers and browsers see. If you want to see the header responses then use -D
flag.