Knowledgebase

Solving the problem of subfolders and subdomains in addon domains

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.

  • 4 Users Found This Useful
Was this answer helpful?

Related Articles

Prestashop update

Update Prestashop To update Prestashop to the new version, the following steps will be carried...

Viruses on the web. Help!!! What are they and how do we eliminate them?

Lately, cases of websites that are infected by viruses or malicious code, without the webmaster...

How can I manage the domain?

For everything related to the administration of your domain, you must use the CPANEL control...

What is a subdomain?

Subdomains are extensions that we can use with our domain, for example, suppose that our domain...

How to publish my website?

To upload the content of your website to the server you can use any FTP client such as FileZilla,...