Forum Moderators: phranque

Message Too Old, No Replies

domain to url

How to redirect a domain to an url?

         

dieselboy

9:59 am on Aug 19, 2003 (gmt 0)

10+ Year Member



Hellow,

I'm working with my own webserver and i got many domains stacked on it. Everything works but I'm searching for 2 things:
1)If I surf to domain.tld I want it to point to [url...] (the url is on another server).

2)If I surf to domain.tld I want it to point to [url...] (the url is on another server) and the browser-window still says that you're at domain.tld.

Maybe I can do this with .htaccess? but how then? or is there a unixprogram for this?

tnx in advance

claus

10:14 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I think you'll find the answers using post #4 of this thread:

"To mirror or not to mirror"
[webmasterworld.com...]

It involves setting up your server as a mirror using the .htaccess file - you probably also need the "Dynamic Mirror" solution.

/claus

Dreamquick

10:28 am on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1)If I surf to domain.tld I want it to point to [url...] (the url is on another server).

Basic redirect - use .htaccess to do it or even a meta redirect if you don't want to mess with .htaccess

2)If I surf to domain.tld I want it to point to [url...] (the url is on another server) and the browser-window still says that you're at domain.tld.

It requires frames, there's no other way to get around it - it's a presentation issue at the client side so .htaccess can't help you here.

Trying to use domain.tld > domain2.tld/~mydir/ will cause you all manner of frame related problems so it might be worth considering alternatives.

- Tony

dieselboy

11:12 am on Aug 19, 2003 (gmt 0)

10+ Year Member



oké, i understand what you mean but I don't know how to do it, the first part can I do with htaccess, how? and the second part must be with frames, how? :s

Maybe someone has got a tutorial or a documentation that is just for this type of problem?

I understand a very bit the .htaccess stuff but DUDES! :) That htaccess is voodoo! :)

I also understand php very well, maybe I can do the second part with that?

So can someone please help me by giving me an example or an url or somethin'?

Tnx

greetz

DaveAtIFG

1:23 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey dieselDUDE, welcome! :)

Check out our extremely cool charter [webmasterworld.com], the part about we'll help ya with your homework but not do it for ya is what's happenin' here.

One of our homies may get down and do your homework for ya, but if not, here's [webmasterworld.com] a righteous little .htaccess tutor. Hit the books Dood! :)

claus

3:02 pm on Aug 19, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



LOL Dave kewl speak :)

Dreamquick:
>> there's no other way to get around it

I'll challenge that. There are always more than one way of doing things (see below). I agree that using frames is the easiest solution here, and i'll even post...

... the code for dieselboy (just put this in the index.html file of "domain.tld" and forget about the htaccess stuff for now, there's too much to read and this will get you running in five minutes):

<FRAMESET>
<FRAME SRC="http://url/map">
<NOFRAMES>
For a no-frames version click <a href="http://url/map">here</a>.
</NOFRAMES>
</FRAMESET>



TAAMTOWODT

  1. You can use frames,
  2. You can do it in the DNS records; point both domains to the same IP, one to the other, or whatever,
  3. You can do it with "CSS" - clever serverside scripting (Perl, Python, PHP, ASP, whatever...),
  4. You can do it with .htaccess, the method is called "Dynamic Mirror" and i provided the (link to the) link in post #2, here's the example from the Apache documentation:

The trick is the P flag, that's shorthand for throughput proxy:

RewriteEngine on
RewriteBase /~quux/
RewriteRule ^hotsheet/(.*)$ [tstimpreso.com...] [P]

With this in the address line of the browser:

1) http // www.your-domain.tld/~quux/hotsheet/page.htm

...you will now see the content that is here (on another domain):

2) http // www.tstimpreso.com/hotsheet/page.htm

-just add water, and please note that option #3 above ("CSS") spans a very large set of possible ways to do this kind of thing ;)

/claus



BTW: Welcome to WebmasterWorld dieselboy :)

dieselboy

3:42 pm on Aug 19, 2003 (gmt 0)

10+ Year Member



DAMN TNx!

Why didn't I found this forum earlier? :) Sorry that I made some mistakes with what I asked!

I love it here already (lol I just signed in!).

See ya laterz, and i hope I can help you guyes to later on!

Greetz!

And lots of thanx (and sorry about my bad english)