Jump to content

Redirecting main domain


Recommended Posts

My "main domain" in cPanel is i7grendel.heliohost.org. My actual primary domain is i7grendel.tk. The site I host is build so the login form only works properly if you log in from i7grendel.tk. Is there a way I can make i7grendel.heliohost.org automatically redirect to i7grendel.tk? (so it will show i7grendel.tk in the URL bar as well). Or is there a way I can change my main domain to i7grendel.tk, and circumvent the issue in that way.

Link to comment
Share on other sites

Just put this code in your index.html file ...

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title>i7grendel.tk</title>

<meta http-equiv="REFRESH" content="0;url=http://www.i7grendel.tk"></HEAD>

<BODY>

You Are Being Redirected ...

</BODY>

</HTML>

Link to comment
Share on other sites

Brother Hassan's method will work, but the more SEO-friendly way to do this would be to use htaccess. Create (or edit) a file named ".htaccess" in your root directory (public_html) and paste the following line in it:

 

Redirect 301 i7grendel.heliohost.org i7grendel.tk

Link to comment
Share on other sites

Well, I've tried to do the .htaccess way, but it caused my site to go 500 for as long as I used that file. My default index.php pulled the starting page (in my case: news.php) from the database and redirected to that. I was unable to make it so it would work properly with the database, so I took the simple php redirect way. This will work fine until I change my default starting page.

 

Here is my .htaccess (copied to notepad), to check for conflicts with cl58's script.

htaccess.txt

 

Oh, and if anyone could rewrite my index.php to get the main page from my database, that would be very appreciated as well.

index.php

Link to comment
Share on other sites

As I've stated in my first post: i7grendel.heliohost.org is my main domain, but you can't use my website if you try to login from that domain, because it only allows logins from (the parked) i7grendel.tk domain. That's why I need to redirect i7grendel.heliohost.org to i7grendel.tk. Either that, or change my main domain, but I don't trust .tk well enough for that.

Link to comment
Share on other sites

Yes, you could just use PHP or HTML to make the redirect. Create a file called index.html/index.php and paste in one of the following codes:

 

<?php
header("location:http://www.i7grendel.tk");
?>

 

<html>
<head>
<meta http-equiv="REFRESH" content="0;url=http://www.i7grendel.tk">
</head>
<body>
</body>
</html>

Link to comment
Share on other sites

I've checked the default index.php of my CMS, and found it relatively safe to exchange it with a redirect PHP, which is what I have now. I would prefer the .htaccess way, if at all possible, but I haven't been able to do so.

 

And I don't trust .tk because of this: http://dottkscam.blogspot.com/2010/02/dot-...m-stealing.html. My site gets a lot of traffic the last few days (10k in a week, for no apparent reason, on a site which is just a personal blog), so I wouldn't be that surprised if my site showed up at Sedo in a few weeks.

 

So, if you want to help: tell me what to do with the .htaccess, because I know of the HTML/JS and PHP redirects.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...