Reorg of D site

Unknown W. Brackets unknown at simplemachines.org
Thu Apr 17 21:16:05 PDT 2008


You're pretty much right in everything you've said... but some 
clarifying points:

1. See the spec <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>.

Here the important status codes are "302", "303" and "307". 
Essentially, 307 is 302... created because almost every client and 
server treats 302 as if it were 303.  You pretty much have to.

2. 301 is sometimes overused, because it will carry Google page rank 
while other 3xx codes will not.  301 is also normally cached, unlike the 
others which normally aren't (even if cache headers say to, most clients 
  and proxies ignore them.)

3. Refresh using <meta /> is essentially the worst case.  It provides a 
worse experience for the user (Refresh cannot happen until the source 
page finishes loading), it relies on HTML (so obviously cannot work for 
images, RSS feeds and other content delivered over HTTP), there are 
syntaxes of <meta http-equiv="Refresh" /> which are not supported by all 
clients, etc., etc.

4. Note that the <meta http-requiv="" /> element/attribute pair exists 
to emulate an HTTP header in HTML.  Technically, one could send a 
Refresh header over HTTP (which would be ignored by many clients mind 
you) but no one would ever do that...

5. Your example is probably overdoing it.  If someone has a client that 
doesn't support/allow you to Refresh, it's unlikely JavaScript will do 
you any better.  It's probably a waste of bandwidth.  And, clearly, 301 
is better in every case for this specific example...

-[Unknown]


Stewart Gordon wrote:
> "Unknown W. Brackets" <unknown at simplemachines.org> wrote in message 
> news:fn891s$1ncq$1 at digitalmars.com...
>> Yes, a 301 should work like that (as would 302.)
> 
> <snip top of upside-down reply>
> 
> Yes, HTTP redirection using a status code in the 300s is the best way.  
> But you should use the right code!
> 
> In this instance, the correct code would indeed be 301 (moved 
> permanently). 302 (found) would probably be the right one for 
> redirecting the advertised URL of a site to the URL where it's actually 
> hosted, but it seems a number of redirection providers wrongly use 301.  
> (That said, I can't seem to make out by a quick read the difference 
> between 302 and 307.)
> 
> The trouble is that, depending on the hosting provider and server 
> software, one may or may not have the means of setting up HTTP 
> redirection.  Meta refresh thus provides an alternative means.  However, 
> one should not use _only_ meta refresh!  Some browsers provide a means 
> of disabling it.  This is yet another reason (besides search engines) 
> that you should always have a plain HTML link as a fallback.
> 
> view-source:http://www.lrca.org.uk/
> or, if this doesn't work for you
> http://validator.w3.org/check?uri=http://www.lrca.org.uk/&ss=1
> 
> demonstrates a three-level approach to redirection: meta refresh, 
> JavaScript and finally a link on the page.
> 
> Stewart.
> 


More information about the Digitalmars-d-announce mailing list