httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chengas123 <>
Subject [users@httpd] mod_rewrite question - How to avoid Apache's 301 redirect to add trailing slash?
Date Wed, 27 Feb 2008 07:40:45 GMT


I signed up for a hosting account that can support many domains.  One domain
is the root web folder and all the others are subdirectories in that folder. 
This gets confusing to maintain, so I’d like to move the main domain into a
sub directory too.

I’ve gotten pretty far using mod_rewrite:
<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond %{HTTP_HOST} ^(www\.)?lumidant\.com$
  RewriteRule ^(.*)$ /lumidant/$1

However, I still have one bug left in this implementation, which shows up
when I request a directory without a trailing slash.  For example, becomes because Apache
does a 301 redirect to the actual file path to add the trailing slash.  Any
suggestions on how I would keep this URL as in the
address bar?  I’m guessing I have to do a 301 to in
mod rewrite before Apache does it to, but I’m
not sure how to do this without also adding a trailing slash to files as


View this message in context:
Sent from the Apache HTTP Server - Users mailing list archive at

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