From d3cdabcac7feb8c62451ac12a22256c0eff16873 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 29 Feb 2020 22:08:30 +0100 Subject: Add URL rewrites/replacements --- src/phinde/Fetcher.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/phinde/Fetcher.php') diff --git a/src/phinde/Fetcher.php b/src/phinde/Fetcher.php index dccb118..7cf11b7 100644 --- a/src/phinde/Fetcher.php +++ b/src/phinde/Fetcher.php @@ -15,12 +15,15 @@ class Fetcher */ public function fetch($url, $actions, $force = false) { + $url = Helper::rewriteUrl($url); + $esDoc = $this->es->get($url); if (isset($esDoc->status->location) && $esDoc->status->location != '' ) { //TODO: what if location redirects change? $url = $esDoc->status->location; + $url = Helper::rewriteUrl($url); $esDoc = $this->es->get($url); } @@ -53,6 +56,7 @@ class Fetcher } $effUrl = Helper::removeAnchor($res->getEffectiveUrl()); + $effUrl = Helper::rewriteUrl($effUrl); if ($effUrl != $url) { $this->storeRedirect($url, $effUrl); $url = $effUrl; -- cgit v1.2.3