httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Kay <>
Subject [users@httpd] Internal Recursion with mod_rewrite
Date Mon, 29 Jun 2009 16:13:16 GMT

Hello all,

I'm embedding Gallery2 in PmWiki, and trying to get rewrite rules to work for both of the
applications.  Each has separate rewrite rules, but I'm having trouble combining them...I
seem to have a problem with recursive internal redirects, which I don't understand, as every
rule uses the [L] command.

The rules are contained in an .htaccess file.

My .htaccess file:

<IfModule mod_rewrite.c> 
     RewriteEngine On 

     # Send requests without parameters to pmwiki.php. 
     RewriteRule ^$           pmwiki.php  [L] 

     RewriteCond %{REQUEST_FILENAME} -f [OR] 
     RewriteCond %{REQUEST_FILENAME} -d [OR] 
     RewriteCond %{REQUEST_FILENAME} gallery\_remote2\.php 
     RewriteRule .   -   [L] 

     RewriteCond %{THE_REQUEST} /Main/Gallery/([^?]+)(\?.|\ .) 
     RewriteRule .   /Main/Gallery?g2_path=%1   [QSA,L] 
     # Send any other requests to pmwiki.php, appending the query string 
     RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1  [QSA,L] 

I'm using Apache 2.2 (as a side question - should rewrite rules that work for 2.2 work for
other versions?).

The pmwiki requests work fine (so works) as do links to any pmwiki stuff (so pulls up the correct embedding pmwiki request), but...

If I try to go to it doesn't work.  I expect it to get rewritten
as (which does work if I go there directly).

I get a 500 Internal Server Error, and the error_log gives:

   Request exceeded the limit of 10 internal redirects due to probable 
   configuration error. Use 'LimitInternalRecursion' to increase the 
   limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: 

I'm a bit baffled, as all the rules have [L].  Any ideas?


--Peter Kay


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