This Script Redirects the current page/blog to another Blog/Site or same Blog/Site. That page will display the search result for the Blog Post Title.
This is not a 301 redirection method. Its just for making easy for user to get to that post easily without any problem from a 404 page.
This can be used to convert 404 pages into search results. Read More about Implementation here(Coming Soon).
1)Fetching the last part of URL of Site A.
2)Clean it. Remove all unwanted hyphens and replace it with search.
3)Optional : Remove the extension .html from the string.
4)Take this formatted string to site B's search and make it a search. (In Most Cases the results will be narrowed as URL is being chopped out.)
Visit my Blog Post(coming soon). Still not convinced ? Feel free to contact me.