Rewrite Size limitation

#1
I saw the thread about the 32k rewrite size limitation..can that be user specified or made larger? we have lots of rules...to import from our current apache configuration.
 

mistwang

LiteSpeed Staff
#2
We will increase the limit to 512KB in future release, is that large enough?

That is the size limit of signle XML entry, it is fine as long as the total size of one group of rewrite rules is not over the limit. Rewrite rules in .htaccess does not have this limit.

Apache's rewrite engine is not very efficient, so I expect big performance boost for web sites using a lot of rewrite rules when switching to lsws, hope you can share the result with us. thanks.

George Wang
 
#3
Well currently our .htaccess file is just around 64 k so that should be fine..I would hope... we have 3 clusters of apache servers with mysql db backends, looking at ways to improve performance.
I will run some tests using the rewrite rules during our bencmarks and will share that section with you. Thanks for a fine product.
 
#4
Also I believe I can really reduce the rules by using RewriteMap However I believe..that has to be defined in the httpd.conf file, I tried adding a definition for a the map file, but the rewrite rule doesnt seem to be using the map file via references in the .htaccess file. Basically I want to convert certain urls the contain the name of a state to its abbreviation..
Instead they have a seperate rule for EACH state... and this is done for several URLS.. I am not the web page designer/programmer I am a system admin. Do you know of any issues with rewritemap? Can it be used with .htaccess defined rewrite rules?
Thanks
 

mistwang

LiteSpeed Staff
#5
Yes, you can use RewriteMap together with rewrite rules defined in a .htacess file, at least with LSWS. The RewriteMap must be defined at vhost level under the "Rewrite" tab for that vhost using the web admin interface, then that rewrite map can be referenced by any rewrite rule.
 
#6
Well I am having problems. I set th map file in the vhost section, with the path etc htstatemap

alaska AK
alabama AL
arkansas AR

in the .htaccess file as a test I have
RewriteEngine on
RewriteBase /morbidobesity/
RewriteRule ^statetest\+(.*).html$ list-hospitals.phtml?State=abbr:$1 [QSA]

and I access the URL /statetest+alaska.html I get:
2005-08-10 13:19:53.900 [INFO] [65.5.164.39:3501-0#server3.gcisnet.net] [REWRITE] Source URI: 'statetest+alaska.html' => Result URI: 'list-hospitals.phtml?State=abbr:alaska'

Mod rewrite IS working with other tests I do, its the map lookup I cant make work.
I wound mention that its ..ah very bad to put $abbr:$1 I seemed to get some form of loop and had to kill the server.
Any ideas...? Should I move this to a different forum?

LLoyd
 
#8
sheesh...I swear I did...but its working, thanks...still having some issues with size of the file, but I think I can get it down using the map enough to demo to the rest of the staff. Thanks for your help.
 

mistwang

LiteSpeed Staff
#9
You are welcome.

You'd better add a default value for the map, there is bug will crash the server when no match found. it will be fixed in next release.

Code:
RewriteRule ^statetest\+(.*).html$ list-hospitals.phtml?State=${abbr:$1|unknown} [QSA]
 
Top