Re-directing domains

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re-directing domains

Post by spacebiscuit »

Hi,

i'm not sure if this is the correct place to post this question but here goes.

I want a domain to redirect to another domain. I have seen the frames method of doing this but when I browse the target URL the address bar just displays the root address of the of the second domain regardless of the page(s) viewed.

I am sure I have seen a method whereby the URL is re-writeen or replace with the new doamin name and correctly displays the directory/structure of the target site?

Any ideas? Thanks in advance,

Rob.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-directing domains

Post by pickle »

Do you have access to your apache configuration files? If not, can you use an .htaccess file?

By the way - I've moved your thread to "Installation and Configuration". The previous forum wasn't wrong, but this one gets more traffic.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

I do not have direct access no, but could possible i fI ask my host.

What is the htaccess method?

Thanks,

Rob.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-directing domains

Post by pickle »

Do a Google for "htaccess redirect" or "htaccess domain redirect" - there are lots of tutorials out there.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

Are ou sure this method will display the new doamin in place of the original domain?

Thanks,

Rob.
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Re: Re-directing domains

Post by VladSun »

I'm pretty sure - try it :)
There are 10 types of people in this world, those who understand binary and those who don't
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

No all I can find are methods which re-direct and display the target site's domain name. The only way I can find to use the new sites domain is by clocking but this uses frames which I do not want to use as it does not read my session variables.

Thanks,

Rob.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-directing domains

Post by pickle »

Depending on which tutorial you've found - it depends. Doing a "redirect" from domainA.com to domainB.com will forward any requests for domainA.com to domainB.com - so a user looking for http://www.domainA.com/ will be forwarded to http://www.domainB.com & see http://www.domainB.com in their address bar.

If you're interested in having http://www.domainB.com appear, but have http://www.domainA.com show in their address bar, you're looking for a "rewrite".
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

I need a re-write then I guess.

Not only has domainA got to show in the address bar but it must also replace domainB in the address bar. Like I said cloaking/masking does not work as my session variables are then not read.

Thanks,

Rob.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-directing domains

Post by pickle »

Well, look into mod_rewrite then.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

I am going around in circles - my google search keep bringing up papes that I have viewed hours ago.

Any links to a tutorial would be apprciated.

Many thanks,

Rob.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Re-directing domains

Post by pickle »

I don't know of any other than what Google would bring up.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Re-directing domains

Post by spacebiscuit »

I actually don't think it is possible with the rewrite_mod - it has to be done server side with an alias.

Thanks,

Rob.
Post Reply