[ic] Using mod_rewrite AND mod_interchange

Kevin Walsh kevin at cursor.biz
Tue Apr 13 06:32:32 EDT 2004

Bryan D Gmyrek [gmyrek at U.Arizona.EDU] wrote:
> I already have mod_interchange and mod_rewrite working.
> Problem is getting them working together.  For example
> if I have /store set up as the path for mod_interchange
> and then want to rewrite something to it such as:
> (in .htaccess or httpd.conf)
> RewriteRule ^/foo/(.*)$  /store/scan/st=db/sf=title/se=$1 [PT,L]
> Then I try
> http://www.foo.com/foo/what.html
> I get the interchange page with error
> Sorry, the page (foo/what) was not found
> This *does* work if I use the cgi link program and the rewrite
> rule is
> RewriteRule ^/foo/(.*)$  /cgi-bin/store/scan/st=db/sf=title/se=$1 [PT,L]
> So I guess the short of it is how do you use rewrite rules and
> mod_interchange together?  I've tried putting the rules in httpd.conf
> *before* the <Location /store> lines but to no avail.
Surely, if you have <Location /store>, your RewriteRule would have to
look more like "^/store/foo/(.*)$" instead of "^/foo/(.*)$".

> There are no entries in the error logs for the catalog, in the
> man interchange dir, or the apache logs.  I figure because
> I get the ic error page and not just 'page not found' then IC
> must be getting the request, but not sure why it doesn't process
> it 'normally'.
I have websites with rewrites and mod_interchange working together.
Mostly these rewrites are to change an old URI (such as "/cgi-bin/shop")
to a new one (such as "/") for temporary backward compatibility with
search engine listings.  Make sure you have RewriteEngine switched on.

I've not tried [PT] with mod_interchange, but I can't think of any
reason why it'd fail.  Maybe I'll give it a try later.

Ignoring all of the above for a moment: why are you using RewriteRule
for this anyway?  Try an ActionMap instead.

   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

More information about the interchange-users mailing list