10-02-2015, 06:46 PM
Its a very useful tool for Seo and can prevent from hacking attacs your WP site. I have create a mysql query and assigned to table wp_WP_SEO_Redirection_LOG as an insert trigger to table wp_WP_SEO_Redirection. I have done this to do not manually assign a lot of logged urls to redirect and have them there.
Any way, the query as a trigger is
Cheers
Any way, the query as a trigger is
Code:
INSERT INTO wp_WP_SEO_Redirection ( enabled, redirect_from, redirect_from_type, redirect_from_folder_settings, redirect_from_subfolders, redirect_to, redirect_to_type, redirect_to_folder_settings, redirect_type )
SELECT DISTINCT 1 AS enabled, rfrom, "Page" AS redirect_from_type, 0 AS redirect_from_folder_settings, 0 AS redirect_from_subfolders, rto, "Page" AS redirect_to_type, 0 AS redirect_to_folder_settings, "301" AS redirect_type
FROM wp_WP_SEO_Redirection_LOG
WHERE rfrom not in (Select redirect_from from wp_WP_SEO_Redirection)
Cheers