httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Hansen <...@el-lal.dk>
Subject [users@httpd] mod_rewrite and performance question
Date Thu, 17 Jun 2004 22:35:32 GMT
Just a quick question about mod_rewrite. I’ve read in various documents 
that up to 50 global rewrite rules doesn’t impact the sites performance 
that much, however….I’m a bit paranoidJ

I have the following rules in my conf.

#This will fetch all /lang-*/ from HOST/lang-* on apache
RewriteRule ^/lang-(.*)$ /%{HTTP_HOST}/lang-$1 [L,PT]
#this will forward all francais requests and format it to the CMS. This 
rule will have to be repeated #for all the supported languages.
RewriteRule ^/(francais)(.*)$ 
/<path_to_cms>?page=redirect&subPage=$2&language=$1 [L,PT]
#Then I have 8 more entries for a specific file. CODE NOT INCLUDED

I only want to execute these rules on all the subdomains of a specific 
domain and not www.mydomain.com or any other domain other than 
mydomain.com.

I tried using the RewriteCond %{HTTP_HOST} !^www.*$, but eventhough I 
put this as a conditions, the rules got processed, but ofcource they 
didn’t match because of the condition.

This to be looks like a lot of overhead and I would like to avoid it.

The only solutions I’ve come up with myself is:
RewriteCond %{HTTP_HOST} ^www.*$
RewriteRule ^(.*)$ $1 [L]
This would match all requests for www. Process the rule, do nothing and 
stop processing any more rules..

Does anyone has any better ideas?

Best regards


Lars Hansen



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message