External RewriteMap global or in all vhosts

Discuss practical ways rearrange URLs using mod_rewrite.

External RewriteMap global or in all vhosts

Postby sqm » Fri Jan 16, 2004 1:24 am

hi forum,

i have the following problem:

i am using an external RewriteMap

Code: Select all
RewriteCond     %{REQUEST_URI}  .html$
RewriteMap      rewrite-static  prg:/usr/local/bin/rewrite_static
RewriteRule     ^/(.*).html$    /${rewrite-static:$1}


to transform static urls into dynamic ones for php.

I am using vhosts (about 500) and would like to use this rewriting in every vhost.
When I put the above lines in all of my vhost files, apache opens the file /usr/local/bin/rewrite_static once for every vhost and runs out of memory.
When I put the above lines to my httpd.conf, the rule does not work at all.
Why? do I have to put it in a special section (tried IfModule)?

Or is there any other way to transform the url
Code: Select all
/index,lang,en,id,8.html
into
Code: Select all
/index.php?lang=en&id=8
for an unknown number of key/value pairs? (in normal RewriteRules only 4 key/value pairs are allowed, as the max. number of backreferences is $9)

any help or ideas appreciated!!

sqm
sqm
 
Posts: 2
Joined: Thu Nov 27, 2003 7:31 am

Postby iiinetworks » Sun Jan 18, 2004 10:16 pm

In general, I haven't had much luck with external RewriteMaps that are programs (scripts). I have found that it works better to pass this info into the script as something like index.php?parameters=lang,en,id,8. Then you just need to split parameters internally and make the appropriate assignments.

Also, for what you want to do, you may want to look at viewtopic.php?t=287

Hth,
Matt
iiinetworks
 
Posts: 8
Joined: Sat Oct 11, 2003 11:53 am


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 35 guests

cron