Hi,

I have three domains connected on my webhost. On first i have site, and names of other two domains associated with content on the site.

I want to redirect this domains to site, i heard that i can do from web hosting panel or with htaccess and etc.

What you sugest and how to do that? Maybe one day i will make specific sites on each domain individually, but when i collect enough material for each particular.

Dani AI

Generated

Short summary and quick recommendation based on the replies from , and : decide whether you want the extra domains to be simple aliases (parked domains that keep their URL) or actual redirects (send users and search engines to the main site). Aliases are easy but create duplicate-content issues. Redirects are cleaner for SEO. Because you said you might use the domains later, consider a temporary (302) redirect now and switch to a permanent (301) when you consolidate for good.

Practical steps you can apply right away:

  • In DNS, point each domain to your host (A record to the server IP; use CNAME only for subdomains). Lower the TTL before making changes to speed propagation.
  • On the host: either add the domains as aliases/parked domains in your control panel, or create a small virtual host that performs the redirect. Example (Apache virtual host — change to 301 for permanent):
<VirtualHost *:80>
    ServerName otherdomain.com
    Redirect 302 / http://maindomain.com/
</VirtualHost>

If you run Nginx, use a server block:

server {
    listen 80;
    server_name otherdomain.com;
    return 302 http://maindomain.com$request_uri;
}

If you only have shared hosting without server config access, most control panels offer a “Redirect” or “Parked/Aliases” option. Registrar forwarding can also do redirects but watch out for framed/masked forwarding.

Important cautions and checks:

  • HTTPS: a redirect from will still present a certificate for otherdomain before the redirect. Obtain SSL for each domain (Let’s Encrypt or your host) or ensure users hit http first; HSTS makes this sensitive.
  • SEO choice: use 302 if truly temporary; use 301 to consolidate permanently. After a 301, use Google Search Console’s Change of Address and update internal links.
  • Test and troubleshoot: check responses with curl -I http://otherdomain.com/somepage to confirm status and Location header, inspect server access/error logs, and verify Host headers are accepted.

Recommended Answers

All 5 Replies

Your description is not clear. You have three domains and where are they pointing to at this moment? do you want all three domains to point to the same website? If so, just go into the DNS management of each domain name and point it to the IP of the webserver that is hosting the website where you want the three domains to be "linked" to. Then on the website, you need to make sure that the web server is accepting traffic for all three domain names. For IIS you would modify the host headers. Not sure for Apache. If you are hosting this web site with a provider, their webiste management console will allow you to add the multiple domain names to the website.

Unless you need to perform a redirect from an old link, say domain1.com/somefolder/somefile.htm --> domain2.com/somefolder/somefile.htm, you do not need to modify the .htaccess or if your running IIS/Windows, URL Rewriting.

I'm not clear with your questions, by the way you can try with htaccess file by root folder.

you can do 301 redirect using .htaccess file.

You are correct in thinking that this can be done from a 301 redirect in the .htaccess file, or through your hosting company or domain name registrar. I don't know who your hosting company or registrar is, so I can't help you there. You should be able to call up their technical support and ask them how to do it.

However, I can tell you how to do it through an .htaccess file. To force every domain to redirect to a particular domain (such as www.daniweb.com), put this in an .htaccess file in the root directory.

RewriteEngine on

# Force everyone to use www.daniweb.com
RewriteCond     %{HTTP_HOST}    !^www.daniweb.com$              [NC] 
RewriteRule     ^(.*)$             [R=301,L]

What you want to ask , your questen is not clear

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.