This is a discussion on how this works (redirection??) within the Apache Web Server forums, part of the Web Server and Related Forums category; Many times you go to a website, say xyz.org The moment it opens up in browser window, the address ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Many times you go to a website, say xyz.org
The moment it opens up in browser window, the address is changed to www.xyz.com in the title bar. Basically, how is this achieved ? Am I looking at an apache configuration ? Or is this an html trick ? Mike |
|
|||
|
With neither quill nor qualm, siliconmike quothed:
> Many times you go to a website, say xyz.org > The moment it opens up in browser window, the address is changed to > www.xyz.com in the title bar. > > Basically, how is this achieved ? > > Am I looking at an apache configuration ? > Or is this an html trick ? A simple redirect will (usually) do it: <META HTTP-EQUIV="refresh" CONTENT="0;URL=http://my.newplace.com/"> -- Neredbojias Contrary to popular belief, it is believable. |
|
|||
|
Previously in alt.html,alt.apache.configuration, siliconmike
<siliconmike@yahoo.com> said: > Many times you go to a website, say xyz.org > The moment it opens up in browser window, the address is changed to > www.xyz.com in the title bar. Please use example.com for example urls. That's what it's there for. :-) > Basically, how is this achieved ? Usually by sending a 301 (moved permanently) or 302 (found) HTTP status code to the browser, pointing to the other site. Others in the 3xx series could also be used, as appropriate. > Am I looking at an apache configuration ? Assuming your site is hosted with Apache, of course. ;-) Yes, it can be done on the web server. It can also be done in a server-side scripting language, such as PHP: header('Location: http://www.example.com/'); > Or is this an html trick ? It can (kind of) be done in HTML, as per Neredbojias' post, but is better handled server-side. -- Mark Parnell http://www.clarkecomputers.com.au alt.html FAQ :: http://html-faq.com/ |
|
|||
|
Neredbojias wrote: > With neither quill nor qualm, siliconmike quothed: > > > Many times you go to a website, say xyz.org > > The moment it opens up in browser window, the address is changed to > > www.xyz.com in the title bar. > > > > Basically, how is this achieved ? > > > > Am I looking at an apache configuration ? > > Or is this an html trick ? > > A simple redirect will (usually) do it: > > <META HTTP-EQUIV="refresh" CONTENT="0;URL=http://my.newplace.com/"> > this will cause first the oldplace.com to load then newplace.com would load. try yahoo.org - they take you to yahoo.com without double loading.. is this a dns trick or what? Mike |
|
|||
|
siliconmike wrote:
> Many times you go to a website, say xyz.org > The moment it opens up in browser window, the address is changed to > www.xyz.com in the title bar. > > Basically, how is this achieved ? You should really be doing the opposite, redirecting http://www.example.com to http://example.com. The www subdomain is a rather nasty hack which should have never been invented, and is deprecated on the modern Web. See http://no-www.org/. |
|
|||
|
|
|
|||
|
Previously in alt.html,alt.apache.configuration, Leif K-Brooks
<eurleif@ecritters.biz> said: > siliconmike wrote: >> Many times you go to a website, say xyz.org >> The moment it opens up in browser window, the address is changed to >> www.xyz.com in the title bar. > > You should really be doing the opposite, redirecting > http://www.example.com to http://example.com. In the OP's example, we are talking about 2 different domains - one is ..org, the other .com. > The www subdomain is a > rather nasty hack which should have never been invented, and is > deprecated on the modern Web. No arguments there. The only time I type www in to access a site is if I've already tried without the www and it didn't work. > See http://no-www.org/. I agree with their philosophy for the most part, but there are more serious issues on that site that the presence or absence of www, like javascript popup links, grey on white text that is really hard to read, inappropriate link text... -- Mark Parnell http://www.clarkecomputers.com.au alt.html FAQ :: http://html-faq.com/ |
|
|||
|
On 10 Aug 2005 17:27:09 -0700, in alt.apache.configuration,
"siliconmike" <siliconmike@yahoo.com> wrote: <snip> >try yahoo.org - they take you to yahoo.com without double loading.. > >is this a dns trick or what? > >Mike It is done by sending a 301 status, generated by the web server: 08/11/05 10:21:45 Browsing http://yahoo.org Fetching http://yahoo.org/ ... GET / HTTP/1.1 Host: yahoo.org Connection: close User-Agent: Sam Spade 1.14 HTTP/1.1 301 Moved Permanently Date: Thu, 11 Aug 2005 14:22:16 GMT Location: http://www.yahoo.com/ Connection: close Transfer-Encoding: chunked Content-Type: text/html; charset=iso-8859-1 The document has moved <A HREF="http://www.yahoo.com/">here</A>.<P> <!-- p1.rc.scd.yahoo.com uncompressed/chunked Thu Aug 11 07:22:16 PDT 2005 --> HTH, Jim |
|
|||
|
With neither quill nor qualm, dingbat@codesmiths.com quothed:
> Neredbojias wrote: > > > A simple redirect will (usually) do it: > > <META HTTP-EQUIV="refresh" ... > > > Please don't do that. Actually, I can't think of a valid reason for doing it. -- Neredbojias Contrary to popular belief, it is believable. |