Jump to content

Recommended Posts

Posted

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.

Posted

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>

Posted

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

Posted

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

Posted

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.

Posted

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>

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...