You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2002/11/06 10:37:21 UTC

DO NOT REPLY [Bug 14291] New: - RewriteRule does not work in configuration

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14291>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14291

RewriteRule does not work in <Directory></Directory> configuration

           Summary: RewriteRule does not work in <Directory></Directory>
                    configuration
           Product: Apache httpd-1.3
           Version: 1.3.27
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: mod_rewrite
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: mccohy@mutant.kyberdigi.cz


It seems the RewriteRule directive does not work inside the
<Directory></Directory>
in server configuration. I have this configuration:

<VirtualHost>
  RewriteEngine On
  DocumentRoot /tmp/pages
  <Directory /tmp/pages/directory>
    RewriteEngine On
    RewriteRule ^(.*)$ $1 [F,L]
  </Directory>
</VirtualHost>

... which does not work. But this configuration works fine:

<VirtualHost>
  RewriteEngine On
  DocumentRoot /tmp/pages
  RewriteRule ^/directory/(.*)$ /directory/$1 [F,L]
</virtualHost>

If I want to use the per-directory configuration, I can create a
.htaccess file in /tmp/pages/directory looking like this:

RewriteEngine On
RewriteRule ^(.*)$ $1 [F,L]

.. and the server configuration like this:

<VirtualHost>
  DocumentRoot /tmp/pages
  <Directory /tmp/pages/directory>
    AllowOverride FileInfo
  </Directory>
</VirtualHost>

This configuration works fine. But I really need this to work in the
global server configuration file, so I can use the example #1, without any 
.htaccess files. I'm affraid this problem is the same for RewriteCond directive
and maybe other directives in mod_rewrite too.

Could anybody please help?

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org