I have registered 3 domains with .com, .co.in and .in extensions. My .com domain is hosted. I want users to be redirected to the .com website when they type in the .co.in and .in urls. How do I do that?
-
In your web server configuration.– Ignacio Vazquez-AbramsApr 19, 2011 at 9:15
-
which webserver are you using?– Marco RamosApr 19, 2011 at 9:28
-
1possible duplicate of Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?– coredumpApr 19, 2011 at 9:41
-
I am a noob in this area. So please make your responses as simple as possible. @Ignacio I am using cpanel, how do I do it from there? @Marco, the site is hosted by a web hosting company. They are running a linux server, I don't know what http server they run.– Ragunath JawaharApr 19, 2011 at 10:00
2 Answers
There are 2 Solutions for this problem
Solution 1:
CNAME Record on the DNS-Server.
IN CNAME example.com.
This DNS Record Redirect the domain e.g. example.io to example.com. If you wan't to redirect a Subdomain e.g. sub.example.io you need to use:
sub IN CNAME example.com.
Solution 2:
Redirect with the Webserver
NGINX:
server {
listen 80;
server_name example.io;
return 301 http://example.com$request_uri;
}
Apache:
<VirtualHost *:80>
ServerName example.io
Redirect 301 / http://example.com
</VirtualHost>
Apache may need to be changed.
- Log into cpanel
- Click 'Parked Domains'
- Add the domains
- Go back to 'Parked Domains'
- Then for each domain:
- Click Manage Redirection
- Enter the address you want the domain to rediect (such as www.example.com)
- Click save
Remember: your .co.in and .in domains have to be setup to 'point' to your cpanel webhost for this to work (the domain's nameservers set to your cpanel host). You also need to have 2 (or more) 'Parked Domains' available on your cpanel package.