This is with Apache 2.4 webserver.
I copied the hole site from one domain to another. Let us say from olddomain.com
to newdomain.com/subdir/
. The site is a webservice with news and advertisements.
The site has the php application that is adverisement server. This application has many links to olddomain.com
in the code, in config files etc. So links are to the old domain. These links are literal, not any relative.
May I do anything to redirect all those link to the newdomain? I was thinking about something like .htaccess with redirection but in fact I have no idea to which folder place such a .htaccess.
How to redirect links?
regex
(if you dare) to replace links. Or better, write another php script that loads html file usingfile_get_contents
then usesxpath
to replace links