I’ve been using apache + htaccess for matching URL’s for years now. We’re going to be updating our entire platform soon and I’m wondering if switching to URL matching in php would have any performance impact.
We are using Apache right now (obviously) however with URL’s being matched in PHP would free us to explore alternatives such as nginx+php.
Would this be a good or bad idea?
We did exactly this, setup a table in MySQL of URL’s and PHP would do a
preg_matchagainst each URL rule before deciding what action to take. Then we had a single mod_rewrite rule that pushes every URL through one script.This worked great for us and gives us much more flexibility without having to create hundreds of physcial files for different rules.
We receive 15m unique hits a month and haven’t experienced any issues with this, providing your using suitable caching of the URL’s.