I have an old site wordpress site I am in the process of migrating.
There are about 50000 urls that need to be redirected.
For this I am using DBM files which seem to be working fine, however during load testing I noticed that I am losing about .5 seconds on each request.
Reviewing the logs it looks like the DBM file that has the 50000 is being hit every time.
I changed the DBM from 50000 to 10000 and notice I gained about .25 seconds on each request from the 50000 DBM file.
I would like to be able to do something like this however no matter how I mix and match the code I cannot get it working:
<If "%{REQUEST_URI} =~ m#^abc#">
RewriteMap abcredirects "dbm:/etc/httpd/conf/dbm/abcredirects.dbm"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond ${abcredirects:$1} !=""
RewriteRule ^(.*) /${abcredirects:$1} [R=301,L]
</IfModule>
</If>
<If "%{REQUEST_URI} =~ m#^xyz#">
RewriteMap xyzredirects "dbm:/etc/httpd/conf/dbm/xyzredirects.dbm"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond ${xyzredirects:$1} !=""
RewriteRule ^(.*) /${xyzredirects:$1} [R=301,L]
</IfModule>
</If>
Using the above as sudo code How can I get this to work?
ie.
If url example.com/abc12345.htm
look in abcredirects.dbm
else exit to VirtualHost
If url example.com/xyz12345.htm
look in xyzredirects.dbm
else exit to VirtualHost
If url example.com/abc12345.htm
DO NOT look in xyzredirects.dbm
If url example.com/xyz12345.htm
DO NOT look in abcredirects.dbm
If url example.com/hik12345.htm
DO NOT look in xyzredirects.dbm
or abcredirects.dbm
NO .htaccess unfortunately I cannot use an .htaccess