tags:

views:

63

answers:

1

hey,

im working on a little project of mine and need your help in deciding whether mod_rewrite is performance friendly or parsing each url in php.

urls will almost always have a fixed pattern. very few urls will have different pattern. for instance, most urls would be like so : dot.com/resource

some others would be

dot.com/other/resource

i expect around 1000 visitors a day to the site. will server load be an issue?

intuitively, i think mod rewrite would work better. but just for that peace of mind, i'd like input from you guys. if anyone has carried out any tests or can point me towards the same, id be obliged.

thanks.

+2  A: 

You may want to check out the following Stack Overflow post:

Quoting the accepted answer:

I've used mod_rewrite on sites that get millions/hits/month without any significant performance issues. You do have to know which rewrites get applied first depending on your rules.

Using mod_rewrite is most likely faster than parsing the URL with your current language.

If you are really worried about performance, don't use htaccess files, those are slow. Put all your rewrite rules in your Apache config, which is only read once on startup. htaccess files get re-parsed on every request, along with every htaccess file in parent folders.


To add my own, mod_rewrite is definitely capable of handling 1,000 visitors per day.

Daniel Vassallo
thanks daniel, ive already gone through that post. however, what i really wanted to know is the performance of mod_rewrite vis-a-vis php "rewriting".also, i too think mod_rewrite can handle a 1000 visitors per day. but i like to think im coding for 10x the visitors. that way if it works only 50%, im still covered. thanks for your response!
hasan