PDA

View Full Version : Tons of mod_rewrite rules.. going to kick my servers ass?


b1ng0
2005-04-25, 04:18 PM
Hi all, I have a site in the works that uses a dynamic script but plan on using mod_rewrite to make the site appear to be static and was wondering basically if it is going to be resource intensive or if there's a better way to go. Basically I'm going to be doing something like:


RewriteRule ^/models/tiffanyteen.html$ /page.php?id=1


... only with 2-4 thousand similar lines. Is this going to kick Apache's ass?

Thanks,
b1ng0

swedguy
2005-04-25, 04:31 PM
2-4 thousand lines is a lot, someone mentioned how much load it will add in the Fusker thread. But I don't remember it right now. But the gist of it was, keep it to a minimum. Here's another way to do it if it's possible:

RewriteRule ^/models/([a-zA-Z]+).html$ /page.php?id=$1

I assume you're pulling the id from a DB of some sort. Make the name unique and pull it from the DB that way instead: /page.php?id=tiffanyteen

1 line and that's it. Just a 10 second idea of mine ;)