Cpanel (Php) is looking for images in https://maindomain.com/img instead of https://maindomain.com/subdomain/img

I have taken a copy of code and db from cpanel whose structure is (http://maindomain.com/.....folders) and migrated it to another cpanel server which is at (http://maindomain.com/subdomain/.....folders) After migrating, css links and image links are showing 404 NOT FOUND. I also don't have any .htacess files. I have noticed that images and css links are using url (http://maindomain.com/....img or css folders) rather than considering http://maindomain.com/subdomain/....img or css folders. Can anyone please help me to explain exactly where the problem is? Is it server, code or htaccess. I have tried this on 2 servers, but still the situation is the same.