httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Andersson" <>
Subject Re: [users@httpd] Apache Trailing Slash Fix not working on sub-domain rewrites.
Date Wed, 26 May 2004 14:27:59 GMT
Mike wrote:
>     * (without trailing slash) -
> Breaks
>         ...Becomes

Although it might be possible to fix with .htaccess (I'm not sure, however),
you should talk with your hosting company. What you see is a flaw in their
configuration and in their way to support "subdomains". They should be able
to tell you more as they are (or should be) familiar with their

Most likely they are using mod_rewrite to map the subdomain to a
subdirectory. When the trailing slash is missing, it makes an external
redirect using the real servername and the already rewritten path. It might
not be possible for you to do anything inbetween. A very inefficient
workaround might be to have this in an .htaccess in the main site's root:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} website\.com
    RewriteCond %{REQUEST_URI} /(subdomain1|subdomain2)/
    RewriteRule ^([^/]+)/(.*) http://$$2 [R,L]

That is, if it is a "broken" redirect, redirect to the correct URI. Note
that this will redirect the client twice!

Of course, it all depends on the exact configuration your hosting provider

Robert Andersson

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message