On 9/6/07, James Ralston <[EMAIL PROTECTED]> wrote:

> Now, say that (for whatever reason) we want to redirect all requests
> for any URL-path except / (root) to the root.

>
> Or you could do it using mod_rewrite:
>
>     RewriteEngine On
>     RewriteCond %{REQUEST_URI} !^/$
>     RewriteRule .* http://localhost/ [redirect=permanent,last]
>
> But either approach will, in fact, fail: *all* URL-paths will return a
> redirect to the root, including the root itself.

I'm sure you could get it to work with mod_rewrite. The no-subrequest
[NS] flag might work, or you could add a RewriteCond to exclude the
index.html or you could use a RewriteCond on %{THE_REQUEST}.

In the case of mod_rewrite it is certainly desired behavior that it
act also on the aliased/expanded form of the path. If it didn't do
this, many interesting uses of mod_rewrite wouldn't be possible.

For mod_alias, I agree it would be clearer if it only acted on the raw
path, not the aliased/expanded one.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: [EMAIL PROTECTED]
   "   from the digest: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to