Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apaches mod_rewrite VS. PHP routing?

for some days now I have been trying to make a simple mod_rewrite rule to create friendly URLs, my web host have mod_rewrite enabled but I just can't get it to work.

All the next questions where posted by me:

  1. .htacces to create friendly URLs
  2. Friendly URLs with .htaccess
  3. .htacces NOT working…

None of the answers worked, so I'm thinking now using simple php routing instead and I wanted to know if there is a big performance or SEO difference between the two. And if there is, maybe you know how to fix the mod_rewrite problems posted in my questions.

Thanks.

like image 720
Jonathan Avatar asked Jun 19 '10 09:06

Jonathan


1 Answers

If you're using PHP routing for PHP files only, it would be no problem performance-wise: The interpreter will get started anyway, a new process started, memory allocated etc.

But if you are planning to route requests for static resources like images and style sheets as well, however, don't use PHP routing under any circumstance. It's way too resource-intensive and not what PHP was built for.

I'd say mod_rewrite is the better, leaner solution and it's worth trying to figure it out.

like image 90
Pekka Avatar answered Nov 07 '22 17:11

Pekka