Link to home
Start Free TrialLog in
Avatar of lphillips120898
lphillips120898

asked on

Rewrite Rules - impact if too many???

Hi,

We currently have about 30 Rewrite rules in our httpd.conf for one of our three virtual host.  The Web Infrastructure group is concerned that having too many of these will impact performance.  Is this true?  If so, how do you determine how many is too many?

I'm looking for information that will allow us to determine if we should or should not be using these rewrite rules - as we want/need to add more if it isn't going to impact site performance.  I would also be interested in hearing from those who use large numbers of these rules.

Below is a list of what we currently have.

Thanks,

Lisa

*** LIST ***
     RewriteEngine on

     #Rewrite Rules
     RewriteRule /professionalrecruiting http://www.MyWebSite.com/recruiting_home.html [NC]
     RewriteRule /staffing http://www.MyWebSite.com/staffing_home.html [NC]
     RewriteRule /humancapitalconsulting http://www.MyWebSite.com/hrc_home.html [NC]
     RewriteRule /technology/uk1 http://www.MyWebSite.com/technology/uk1.html [NC]
     RewriteRule /technology$ http://www.MyWebSite.com/technology_home.html [NC]
     RewriteRule /assessment http://www.MyWebSite.com/hrc_solutions_assessment.html [NC]
     RewriteRule /legal http://www.MyWebSite.com/recruiting_services_legal.html [NC]
     RewriteRule /outsourcing http://www.MyWebSite.com/outsrc_home.html [NC]
     RewriteRule /extranet/(.*) http://www4.MyWebSite.com/extranet/$1 [NC]
     RewriteRule /webmail http://webmail.MyWebSite.com [NC]
     RewriteRule /benefitpresentation http://www.MyWebSite.com/selfdirected.html [NC]
     RewriteRule /intranet http://intranet.MyWebSite.com [NC]
     RewriteRule /community/(.*) http://www4.MyWebSite.com/community/$1 [NC]
     RewriteRule /nl http://www4.MyWebSite.com/nl [NC]
     RewriteRule /custom/icc http://www4.MyWebSite.com/custom/icc [NC]
     RewriteRule /terms.cfm http://www.MyWebSite.com/corporate_termsofuse.html [NC]
     RewriteRule /copyright.cfm http://www4.MyWebSite.com/copyright.cfm [NC]
     RewriteCond %{HTTP_HOST} www.MyWebSiteprofessionalrecruiting.com
     RewriteRule (.*)$ http://www.MyWebSite.com/recruiting_home.html
     RewriteCond %{HTTP_HOST} www.MyWebSiteoutsourcing.com
     RewriteRule (.*)$ http://www.MyWebSite.com/outsrc_home.html
     RewriteCond %{HTTP_HOST} www.MyWebSitestaffing.com
     RewriteRule (.*)$ http://www.MyWebSite.com/staffing_home.html
     RewriteCond %{HTTP_HOST} www.MyWebSitehumancapitalconsulting.com
     RewriteRule (.*)$ http://www.MyWebSite.com/hrc_home.html
     RewriteCond %{HTTP_HOST} www.MyWebSitetechnology.com
     RewriteRule (.*)$ http://www.MyWebSite.com/technology_home.html
     RewriteCond %{HTTP_HOST} ^([^.]+)\.staffing\.MyWebSite\.com$
     RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
     RewriteRule ^([^.]+)\.staffing\.MyWebSite\.com http://www.MyWebSite.com/OfficeLocator/$1.html
     RewriteRule /leads http://www.MyWebSiteleads.com [NC]
     RewriteRule /guaranteed http://www.MyWebSite.com/hrc_outplacement.html [NC]
     RewriteRule /wedeliver http://www.MyWebSite.com/staffing_callsource.html [NC]
Avatar of samri
samri
Flag of Malaysia image

Lisa,

I didn't recally seeing any figures on the limit.  And yes, I would say that it will somehow affect the performance.

However, there should be a difference in performance depending on where the rewrite rule is located -- either in httpd.conf or .htaccess file.

There is some discussion on how to fine-tune apache to not searching throughout the website for .htaccess file (if the rewrite rule is in .htaccess),
http://httpd.apache.org/docs/misc/perf-tuning.html

Another link that I found:
http://www.alistapart.com/stories/urls/article.txt
-- some excerpt.
If you're not familiar with Apache, you'll want to read up on how its configuration files work (http://oreilly.apacheweek.com/topics/apache/configuration).
The best place to run mod_rewrite from is your server's httpd.conf file, but you can call it from the per directory .htaccess file as well. If you don't have control of your server's configuration files, you'll need to use .htaccess, but understand there's a performance hit because Apache has to read .htaccess every time a URL is requested.

Given your current rewrite rule, I would say that it should not be alarming.  I personally haven't yet be in a situation requiring too many rewrite rule.  I would say that you are pretty OK, unless you are hitting '000, then you might need to work on some other method.

cheers.
ASKER CERTIFIED SOLUTION
Avatar of BigRat
BigRat
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial