Problem
An additional domain has some negative effects when generating it, among which it stands out that adding an additional domain in turn generates a subdomain and on the other hand the domain is also accessible through the subfolder, for example:
www.yourdomain.com/domainadicional.com
additionaldomain.yourdomain.com
Otherwise, an additional domain is 100% independent, works in the same way as the main domain and works correctly with any application you need.
Solution
Having several possible accesses means that the search engine can consider them as different websites with the same content with the consequent risk that the search engines consider it duplicate content and your users see different addresses for the same website.
In order to solve this problem, we are going to redirect any access that is not from www.yourdomain.com to that address.
We go to the directory created for the additional domain and check if there is a file under the name .htaccess inside (if there is not, we create it, remember a point before the name .htaccess).
We open or download it to be able to edit it and add the following code above the file:
RewriteEngine on
RewriteCond %{HTTP_HOST} !www\.yourdomain\.com$
RewriteRule [yourdomain.com]?(.*) http://www.yourdomain.com/$1 [R=301,L]
Keep in mind that where it says yourdomain.com you must modify it for the additional domain in question.