Zend certified PHP/Magento developer

Weird 301 redirect for the entire site

I’ve made a copy of a Magento folder to set up another domain, swapped the old domain name both in the database (web secure url) and in the filesystem (env.php), and pretty much everywhere I could find it (did a recursive case-insensitive grep for the subdomain name and a search in the database dump) but I’m still getting a 301 redirect to the original website. Where could it be hiding? There are no traces of the old name in the filesystem except some references in the css files and no references to it at all in the database. I’ve hacked the redirect php files and it seems to occur inside Magento. Here’s the trace (url name changed):

string(27) "https://old.webstore.com/"
#1 MagentoFrameworkAppResponseHttpInterceptor[MagentoFrameworkHTTPPhpEnvironmentResponse]#00000000000002390000000000000000#->setRedirect() called at [generated/code/Magento/Framework/App/Response/Http/Interceptor.php:149]
#2 MagentoFrameworkAppResponseHttpInterceptor#00000000000002390000000000000000#->setRedirect() called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:91]
#3 MagentoStoreAppFrontControllerPluginRequestPreprocessor#000000000000022f0000000000000000#->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#4 MagentoFrameworkAppFrontControllerInterceptor#00000000000001750000000000000000#->MagentoFrameworkInterception{closure}() called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:75]
#5 MagentoPageCacheModelAppFrontControllerBuiltinPlugin#000000000000019f0000000000000000#->aroundDispatch() called at [vendor/magento/framework/Interception/Interceptor.php:135]
#6 MagentoFrameworkAppFrontControllerInterceptor#00000000000001750000000000000000#->MagentoFrameworkInterception{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 MagentoFrameworkAppFrontControllerInterceptor#00000000000001750000000000000000#->___callPlugins() called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:23]
#8 MagentoFrameworkAppFrontControllerInterceptor#00000000000001750000000000000000#->dispatch() called at [vendor/magento/framework/App/Http.php:116]
#9 MagentoFrameworkAppHttpInterceptor[MagentoFrameworkAppHttp]#000000000000009d0000000000000000#->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:23]
#10 MagentoFrameworkAppHttpInterceptor#000000000000009d0000000000000000#->launch() called at [vendor/magento/framework/App/Bootstrap.php:264]
#11 MagentoFrameworkAppBootstrap#000000000000000b0000000000000000#->run() called at [pub/index.php:30]