Крат. сестр. тал.
1. Ищем главный файл
index.php – нашли.
2. Включаем буферизаторы:
define('WP_USE_THEMES', true);
if(preg_match('#/o/(.*)#',$_SERVER[REQUEST_URI],$rr)){
header(«Location: http://$rr[1]»);
exit();
}
ob_start();
require('./wp-blog-header.php');
$q=ob_get_contents();
ob_end_clean();
echo preg_replace('#href=(\'|")http://(?!yoursite.ru)(.*?)(\'|")#', 'href=«yoursite.ru/o$2»', $q);
1. Ищем главный файл
index.php – нашли.
2. Включаем буферизаторы:
define('WP_USE_THEMES', true);
if(preg_match('#/o/(.*)#',$_SERVER[REQUEST_URI],$rr)){
header(«Location: http://$rr[1]»);
exit();
}
ob_start();
require('./wp-blog-header.php');
$q=ob_get_contents();
ob_end_clean();
echo preg_replace('#href=(\'|")http://(?!yoursite.ru)(.*?)(\'|")#', 'href=«yoursite.ru/o$2»', $q);