sleepy_sentry — 2013-10-19T04:50:00-04:00 — #1
I recently acquired an old search engine domain that I'm now using for a blog. The name is great, but unfortunately, nearly 10,000 (and counting) broken links for various searches are left behind. I can't seem to find a solution for redirecting only the broken links.
- ErrorDocument 404 / doesn't work. Maybe it's conflicting with my Wordpress .htaccess?
- None of the plug-ins for 301 redirection in Wordpress handle mass redirects.
How can I redirect only the broken links on my site? Any help is greatly appreciated. I'm quite frustrated right now.
picnictutorials — 2013-10-20T12:44:58-04:00 — #2
I don't think I understand where you are trying to redirect them too. But you have the option to do a blanket redirect of the entire domain to the new domains home page.
dklynn — 2013-10-20T22:22:23-04:00 — #3
You've replaced a search engine with a WordPress website?
My first reaction was to give up as WP will "take over" any 404 and redirect to its file handler (index.php). Then, the required "spark" suggested that the search engine used either (likely both) a search page such as search.php (hopefully not the same index.php that WP uses) AND/OR a query string that would have a specific key that you could use as a marker (to avoid the capture by WP). If either of these are the case, please advise and I can help you though the mod_rewrite code.
PT also has a good point: What do you want to do with the search engine's 404's?
sleepy_sentry — 2013-10-23T06:48:46-04:00 — #4
Thanks for the help! I actually just want to redirect them to the homepage. Wordpress seems to be catching these not-founds on its own and sending them to a custom 404 page.
I'd like to set up code to redirect any page that does not exist to my homepage. So if you end up at /search.aspx?cute-kittens or /search.aspx?any-random-string, I'd like the visitor to be redirected to the homepage.
dklynn — 2013-10-23T17:42:09-04:00 — #5
What you're suggesting will disable WP's ability to use strings in your request which allow it to link to entries in its article database. Since mod_rewrite doesn't have the power to look into the database (unless you have SysAdmin privileges), you'll have to modify the WP code for 404 handling. You inferred that there is "a custom 404 page" so you could use that to simply redirect to the "clean" index.php ("homepage") script.