httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Whitmore">
Subject [users@httpd] Rewriting the Trailing Slash
Date Mon, 05 May 2003 20:47:10 GMT
Hi there

I am trying to "fix the trailing slash problem" using rewrite, but the
examples given use RewriteBase which you can't use using vhosts.
Can anyone help? See my existing config below.

ie  ->

If I use the

RewriteCond    %{REQUEST_FILENAME}  -d
RewriteRule    ^/(.*)$           $1/  [R]

then ->

As it can't remove the /home/username/  as you can't use RewriteBase at all.

Craig Whitmore

The Directories are set as /home/username/
/home/username/ etc
with = /home/user1/ /home/user1/ /home/user2/


<VirtualHost *>
        RewriteEngine on
         DirectoryIndex index.html index.htm default.htm default.html

        RewriteMap    lowercase    int:tolower
        RewriteMap    vhost
        RewriteCond   %{REQUEST_FILENAME}  !^/cgi-bin/
        RewriteCond   %{REQUEST_FILENAME}  !^/error
        RewriteCond   %{REQUEST_URI}  !^/icons/
        RewriteCond   %{HTTP_HOST}  !^$
        RewriteCond   ${lowercase:%{HTTP_HOST}|NONE}  ^(.+)$
        RewriteCond   ${vhost:%1}  ^(/.*)$
        RewriteRule   ^/(.*)$   %1/$1  [E=VHOST:${lowercase:%{HTTP_HOST}}]

        ScriptAlias /cgi-bin/ /hosting/cgi-bin/

      #rewriter to add in "banners etc"
      Action add-header /cgi-bin/
      AddHandler add-header .html .htm .shtml


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