Killersites.com Homepage Welcome Guest   |   Register  |  Login
Login Name Password
  Search  
  Index  | Recent Threads  | Unanswered Threads  | Who's Online  | User List  | Help



Quick Go »

No member browsing this thread
Thread Status: Active
Total posts in this thread: 2
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1533 times and has 1 reply
Male FemaleDuck
Stranger




Joined: Dec 16, 2008
Post Count: 1
Status: Offline
Reply to this Post  Reply with Quote 
redirect aliased domain to a file?

We have a website with a main domain and half a dozen domains aliased to it.

I don't know if this is possible but what we are trying to achieve, via .htaccess, is that if someone arrives at one of the domain aliases they are sent to a specific page on the main domain e.g.

someone arrives at the aliased domain domainb.com and is sent to domaina.com/somefile.htm

Everything I have tried so far either has no effect or else returns a 500 internal server error. These attempts include:

simple 301 redirects
mod rewrite redirects

Given that the one domain is purely an alias is it even possible to redirect someone from an alias to a file on the real domain using .htaccess?
P.S sorry if wrong place.
----------------------------------------
Vietnam resort, Vietnam holiday||Tour to Sapa from Hanoi||Asia Beach Holiday - Vacation Packages to Vietnam Beaches

[Dec 16, 2008 10:59:46 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male shelfimage
Advanced Member
Member's Avatar

USA
Joined: Mar 24, 2005
Post Count: 3000
Status: Offline
Reply to this Post  Reply with Quote 
Re: redirect aliased domain to a file?

The htaccess file will need to exist inside of domainb.com's zone. If the master domain on the host account is domaina.com, the server will not know that someone is using domainb.com to arrive.

I'm not sure what options you have available with your registrar and hosting company, but see if the host company has 'add on domains' - this is different than parked domains.

If they do, it creates an account for domainb.com on your existing hosting account. It should create a directory of its own. Then in that directory, you can place your redirect code.

Or, your domain registrar may have domain forwarding. you can forward domainb.com to a directory on your web server and add your redirect in there.

You can try 2 different ways to redirect depending upon what your server supports:

.htaccess:

Redirect 301 / http://www.domaina.com/somefile.htm

OR

Redirect Permanent / http://www.domaina.com/somefile.htm

some cPanel based servers use the second method


with PHP:

add an index.php file to the directory with:


<?php
// Permanent redirection
header("HTTP/1.1 301 Moved
Permanently");
header("Location: http://www.domaina.com/somefile.htm");
exit();
?>



----------------------------------------
"The art of life lies in a constant readjustment to our surroundings." -Okakura Kakuzo
Save the developers<!>
Maine Webworks
[Dec 17, 2008 8:07:59 AM] Show Printable Version of Post    View Member Profile    Send Private Message    mainewebworks    mainewebworks [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread