PDA

View Full Version : how to redirect?


Sai
03-21-2006, 06:27 PM
how do i redirect my main domian name to my addon domain name...

say if someone type in maindomain.com it will redirect to my addondomain.com...

that's what i want. how do i do that?

Sai
03-23-2006, 07:52 PM
bump... anyone?

areidmtm
03-23-2006, 08:47 PM
login to your cpanel and click on Addon Domains, then choose the domain you'd like to redirect from the "Domain Redirection" section and click setup, then enter the URL you'd like to have the domain goto....simple right?

bob_ib
03-24-2006, 12:10 AM
There is an excellent redirection service that is free (for the first 5 redirects):

www.zoneedit.com

Not only can you set up domain redirection, you can also redirect email if you wish. Thus any email sent to you@maindomain.com will go to you@addondomain.com instead. You don't have to include email redirection, but it's there as an option. The parameters for all email would be:

*@maindomain.com > you@addondomain.com

which means any email sent to the first domain is redirected to the address of the second domain name.

It's a very handy service, I've used them for years.

Bob

smiffy
03-24-2006, 02:30 AM
There is an excellent redirection service that is free (for the first 5 redirects):

ww*.zoneedit.com

Not only can you set up domain redirection, you can also redirect email if you wish. Thus any email sent to you@maindomain.com will go to you@addondomain.com instead. You don't have to include email redirection, but it's there as an option. The parameters for all email would be:

*@maindomain.com > you@addondomain.com

which means any email sent to the first domain is redirected to the address of the second domain name.

It's a very handy service, I've used them for years.

Bob
What's the point of that when it only takes a few clicks in a Bluehost user's cPanel to set up a redirect??!

bob_ib
03-24-2006, 02:36 AM
What's the point of that when it only takes a few clicks in a Bluehost user's cPanel to set up a redirect??!
Independence from a hosting service. But nevertheless, I didn't know if he was talking about a Bluehost-hosted domain being redirected or an outside domain being redirected. I was under the impression that the cPanel redirects require the source domain to be hosted by Bluehost in order to redirect it to a target domain.

areidmtm
03-24-2006, 07:58 AM
I dont think so. It allows you to enter any URL you wish. I think that all it does is add it to the .htaccess file for your account. You could also just edit the .htaccess file yourself and have it go anywhere you want.

hofmax
03-26-2006, 08:23 AM
You could also use a cgi script to redirect to your subdomain.

example script:

#!/usr/bin/perl -w

use strict;
use CGI;
my $cgi = new CGI;
use CGI::Carp qw(fatalsToBrowser);

open(FH,">>/usr/web/data/userlog.xml");
print FH "<user-call>\n <remote-host>",
$cgi->remote_host(),
"</remote-host>\n <user-agent>",
$cgi->user_agent(),
"</user-agent>\n <goto-url>",
$cgi->url_param('goto'),
"</goto-url>\n <time-stamp>",
localtime(time),
"</time-stamp>\n</user-call>\n";
close(FH);

print $cgi->redirect($cgi->url_param('goto'));

Another option is to "forward" to your subdomain if you have an index.html in the document root of your top level domain and insert the refresh command into the head section of your document

www.blahblahblah.com

<head>
<meta http-equiv="refresh" content="0"; URL=http://subdomain.blahblahblah.com/">
<!-- ... other meta tags, if required, go here ... -->
</head>

Sai
03-27-2006, 07:59 PM
no that still don't work... i can redirect the addon domain to any domain i like but i want to redirect my main domain to my addon domain...
i've tried subdomain/addon domain redierection option in cpanel. this doesn't work...

how do i edit my .htaccess manually... i mean what do i type in?

i want this... maindomain.com to redirect to addondomain.com

areidmtm
03-28-2006, 07:52 AM
RewriteEngine on
RewriteCond %{HTTP_HOST} ^maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^(.*)$ http://www.addondomain.com$1 [R=301,L]

Sai
03-29-2006, 12:46 AM
RewriteEngine on
RewriteCond %{HTTP_HOST} ^maindomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.maindomain.com$
RewriteRule ^(.*)$ http://www.addondomain.com$1 [R=301,L]


thank you, this works!