Domain redirect

Status
Not open for further replies.

luca85

New Member
Messages
24
Reaction score
0
Points
0
Hi,

Let's say I have a website xyz.co.uk hosted by x10hosting. Then I have another domain called xyz.com. I want to redirect that domain to xyz.co.uk. So, when people go to xyz.com they will be redirected to xyz.co.uk where the website is in place.

Can someone please tell me how to do this, as I've tried it on my own with "park domain" option and then tried to change the server names for the domain and I almost committed web suicide with my website.

Thanks.
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
You can add it as an addon domain and create a file named index.php with the following:

PHP:
<?php
header('Location: http://www.xyz.co.uk/');
exit();
?>

Add the file into your addon domain directory.

Another and possibly better method:

Create a file named .htaccess (dot file - no file name) in your addon domain directory.

Add the following to it:

Code:
Redirect 302 / http://www.xyz.co.uk/

This will create a 302 Redirect on all requests to xyz.com to redirect to xyz.co.uk.
 
Last edited:

tscrap

New Member
Messages
14
Reaction score
0
Points
0
You can also use simple HTTP redirect to redirect your users to the new website. Make an index.php on "/home/username/public_html/index.php" and wite to it the folowing
HTML:
<html>
  <head>
<meta http-equiv="refresh" content="2;url=http://www.xyz.co.uk/">
  </head>
<body>
<center>You are being redirected to our new website!</center>
</body>
</html>
The number 2 before URL is the number of seconds before the user is redirected to the new page.
 

techairlines

x10 Flyer
Community Support
Messages
2,867
Reaction score
165
Points
63
You can also use simple HTTP redirect to redirect your users to the new website. Make an index.php on "/home/username/public_html/index.php" and wite to it the folowing
HTML:
<html>
  <head>
<meta http-equiv="refresh" content="2;url=http://www.xyz.co.uk/">
  </head>
<body>
<center>You are being redirected to our new website!</center>
</body>
</html>
The number 2 before URL is the number of seconds before the user is redirected to the new page.

While Meta Refresh works for redirects, I personally don’t recommend doing this as it is a bit slower and not as Search Engine friendly. See: http://www.seobook.com/archives/000297.shtml
 

luca85

New Member
Messages
24
Reaction score
0
Points
0
Oh, I thought it was something simple to do from cpanel. Like to add my new domain name somewhere in there, not starting to play with HTML codes.

Isn't there an easier way?

:confused:
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
if you set the domain as parked domain in cPanel, both addresses will work and point to the same content.

There will be no redirect though, if they arrive using your xyz.com domain, that is the only domain they'll see in the address bar, and if they arrive on xyz.co.uk that is the only domain they'll see in the address bar.
 

xav0989

Community Public Relation
Community Support
Messages
4,467
Reaction score
95
Points
0
You can set a redirect in cPanel. I don't remember exactly how, but I know you can set up a domain name to automatically redirect to another.
 

luca85

New Member
Messages
24
Reaction score
0
Points
0
Okay Anna, actually that's what I was looking for, to see the same website content on both domains.
But I already added the domain xyz.com in cPanel at parked domains and it didn't worked, I mean I couldn't see the website at that address.
Do I have to change the server names for the new domain and then park it in cPanel?

I don't want to start playing again with settings without knowing what I'm doing.
 

vishal

-::-X10 Guru-::-
Community Support
Messages
5,255
Reaction score
192
Points
63
Okay Anna, actually that's what I was looking for, to see the same website content on both domains.
But I already added the domain xyz.com in cPanel at parked domains and it didn't worked, I mean I couldn't see the website at that address.
Do I have to change the server names for the new domain and then park it in cPanel?

I don't want to start playing again with settings without knowing what I'm doing.

Yes you have to point the name servers to ns1.x10hosting.com and ns2.x10hosting.com
 

luca85

New Member
Messages
24
Reaction score
0
Points
0
I've tried to change the name servers and this is what I get.

"Error text: Registry error, domain's nameservers not updated [Object status prohibits operation]
You cannot alter nameservers if your domain is under a registrar lock. Please remove the registrar lock from your control panel and try again."

The domain name is not parked in cPanel so I don't know what "registrar lock" means, or how to remove it.

Let me know, if you have any idea.

Thanks.
 

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
That sounds as it would be something you would need to ask the domain registrar, as it is at your registrar you have to configure the name servers.

Another option is setting an A record for the domain, the downside of that is that you need to add any subdomains you want to use in both cPanel here and at your registrars control panel.

The IP for your server to use as an A record is 69.175.104.34

Once you updated the A record, or set the name servers if the registrar allow this, you'll need to park the domain in cPanel.
 

luca85

New Member
Messages
24
Reaction score
0
Points
0
Thanks for the help. I found out what the problem was, the registrar had this option somewhere in the control panel, to lock/unlock the domain so that you don't modify anything by mistake.

I've changed the name servers and parked the domain and now when I enter xyz.com it redirects me to xyz.co.uk, along with changing the address from xyz.com to xyz.co.uk.

Does anyone know if I can see the address xyz.com but the content from the xyz.co.uk website. I mean if someone types xyz.com he should see the content from xyz.co.uk (redirect) but instead of seeing xyz.co.uk as the address he should see xyz.com.

Does that make any sense?
 

dlukin

New Member
Messages
427
Reaction score
25
Points
0
When you parked the domain, did you do anything in cPanel to redirect it ? Just parking it should not redirect it.
 

luca85

New Member
Messages
24
Reaction score
0
Points
0
Okay, I've disabled the redirect.

But, now every time I access xyz.com I get this on top of the website "Warning! This copy of Website Builder is licensed for another domain!" and I can't close it or anything.

And every time I want to access another page on the website, I get a pop window from JawaScript with the same message and I have to press OK for the page to be displayed. Also, it's loading quite slow compared to xyz.co.uk

What is up with that?
 
Last edited:
Status
Not open for further replies.
Top