I studied this link,But why the “redirects.yaml” file I wrote does not work?
For starters, don’t include the FQDN, just the path after www.fishol.me
. So, if you want to redirect to the home page simply use:
301:
/old-post/ /
However, redirecting so many posts to home (/) is not a great idea. If no suitable replacement is available after restructuring the site, just allow a 404. Contrary to popular belief, this is not bad, and is the correct approach for pages that are removed.
Finally, use 302s until you are satisfied everything is working, and don’t forget to clear any caching.
How to redirect a link with “.?=” symbol in the link?
For example: /2023/08/blog-post_28.html?m=1: /
How to redirect this link to the homepage?
Read the tutorial on redirection since you could simplify the YAML file using regular expressions.
For your specific example, ?
is a special character, so you’ll need to escape this with an ‘\’.
I also want to set some old links to 404, and Ghost also has a 404 page, but Google Search Console always says not found (404)
You don’t need to do anything for pages that no longer exist as Ghost will automaticall dispkay the 404 page.
If Google sees a 404, this is correct.
The server cannot find the requested resource. In the browser, this means the URL is not recognized. This response code is probably the most well known due to its frequent occurrence on the web.
Oh, I was overthinking. Thank you for your patience and help. Bless you.