Forum Moderators: phranque
As you'll see, I'm not yet completely familiar with the structure of an .htaccess file, so, even with the best annotation, I'm not comfortable making some additions.
This, I believe, is the syntax for the rule....
RewriteRule ^dumpedfile\.html$ - [G] I'm assuming...
a) that this rewrite is what's called an "external" rather than an "internal redirect" (but I can't find definitions of these)...
b) that, like the Rewrite Rules that redirect old pages to new pages, it doesn't need a Rewrite Condition
c) that the last 410 Gone rewrite should have an L flag
d) that it should probably follow my canonical "www" rewrites... and that it should precede any sections that rely on "deferred external redirect flags."
So, this rewrite should be...
RewriteRule ^dumpedfile\.html$ - [G,L] Do I have it right?
As a PS to this, would value input on internal and external redirects, redirect flags, and deferred external redirect flags.
Deferred external redirect: An external redirect that is deferred so that other more-specific conditions can be checked before executing that redirect as a default corrective action.
[added] An internal rewrite changes the file associated with an incoming HTTP URL request; The client is unaware of this change.
An external redirect changes the URL associated with the requested resource and requires client interaction. That is, the server's redirect response terminates the current HTTP transaction with a message that says, "That resource has moved, ask for it again at this new URL." The client must then begin a new HTTP transaction, asking for the originally-requested resource at the new URL given in the server's redirect response. In doing so, a client browser will update its address bar, showing the new URL, whereas a search engine robot client will (hopefully) update its URL database if the redirect response indicated a 301-Moved permanently redirect.[/added]
Jim
[edited by: jdMorgan at 4:41 pm (utc) on April 15, 2007]
You would not redirect non-www to www for that filename and then serve the 410 for the www version. You would directly serve 410 for that filename irrespective of whether www or non-www had been in the original request.
In each case, the word "immediately" means that no [L] flag is needed:
o 'forbidden¦F' (force URL to be forbidden)(Emphasis added)
This forces the current URL to be forbidden, i.e., it immediately sends back a HTTP response of 403 (FORBIDDEN). Use this flag in conjunction with appropriate RewriteConds to conditionally block some URLs.o 'gone¦G' (force URL to be gone)
This forces the current URL to be gone, i.e., it immediately sends back a HTTP response of 410 (GONE). Use this flag to mark pages which no longer exist as gone.o 'proxy¦P' (force proxy)
This flag forces the substitution part to be internally forced as a proxy request and immediately (i.e., rewriting rule processing stops here) put through the proxy
Clear and concise, IMO... :) One reason that mod_rewrite and other Apache documents are so terse is that in many cases, the file-size of the documentation Webpage exceeds the file-size of the module itself. That is the nature of Apache-specific code.
Jim
In each case, the word "immediately" means that no [L] flag is needed.......(Emphasis added)
Clear and concise, IMO... :) One reason that mod_rewrite and other Apache documents are so terse is that in many cases, the file-size of the documentation Webpage exceeds the file-size of the module itself. That is the nature of Apache-specific code.
Concise, yes... and clear with your clarification and emphasis added. Otherwise, perhaps too concise for someone who's not conversant with the terminology and not immersed in it frequently.
Many years back, I was a media consultant to a National Science Foundation project that was exploring problems of teaching math and physics to elementary and high school students. One of the discoveries that the mathermaticians and scientists had a hard time accepting was that students most often failed to understand apparently clear instructional material intended for them because the material overestimated the knowledge level the students brought with them. Unfamiliarity with specialized vocabulary was consistently a problem.
Obviously, Apache documentation is not for non-professionals, and I've got to confess that I often have difficulty reading it. I'm still looking for that fabled introductory book... one with a really good index and glossary that would also serve for reference.
I'm dreading the upgrade from MySQL4 to MySQL5.
[edited by: KenB at 1:40 am (utc) on April 29, 2007]