NYCPHP Meetup

NYPHP.org

[nycphp-talk] mod_rewrite -- what's the big deal?

inforequest 1j0lkq002 at sneakemail.com
Tue Oct 3 12:34:11 EDT 2006


Cliff Hirsch cliff-at-pinestream.com |nyphp dev/internal group use| wrote:

> I’m confused by mod_rewrite
>
> What is the point? What is the big deal?
>
> Why is www.website.com/page/action/stuff/morestuff/
>
> Better than
>
> www.website.com/page.php?action=something&id=#&....
>
> What difference does it make? To me it mainly looks like a major 
> headache making all the queries written in PHP play nicely with 
> mod_rewrite.
>
> Cliff
>
Keeping in mind that my focus is on competitive webmastering (where 
different isn't always better, but different that is faster/more 
transparent/easier etc is always better) you aren't stuck with mod 
rewrite and Apache.

As I know Chris Snyder knows very well ;-) there's more than one way to 
code a front controller. Any way you want to achieve a goal of 
satisfying a virtual URL is fine. Of course if it is slow, resource 
intensive, or allows for duplicate URLs for the same content you would 
be better off with mod_rewrite because it's pretty good and accurate. In 
my opinion, at this time, Apache provides the fastest ways to manage the 
URLs of your site, with several options in addition to mod_rewrite (Tom 
Melendez mentioned proxy, I have used files and directory directives, 
and combinations of PHP and all of the above).

One thing I can promise you is that right now, a URL like 
www.example.com/stuff-catalog/Type-one-stuff/bluestuff.html works much 
better than 
www.example.com/index.php?catalog=stuff&stuff_type=1&view='blue' for 
users, search engines, and archives.

And if you research front controllers, an easy path to enlightenment is 
the symfony framework because the code is good and the front controller 
is well planned. However, I personally would not use it because it is 
sub-optimal in the search engine and competitiveness departments. It is 
a good exercise for understanding front controllers, and to see the 
conceptual limitations that come with abstracting a front controller. If 
you are a search optimizer you can use that as the example to beat, 
because it represents a fairly state of the art implementation of a 
framework/front controller (and therefore represents that status quo, 
which is what you need to outperform).

Hope that's helpful. I am not a PHP guru.

-=john andrews

-- 
-------------------------------------------------------------
"The web is competitive. Just because you can't smell the stench or see the grime, doesn't mean the person on the other end of the connection is a good citizen in an upscale suburban neighborhood making an honest living giving you a fair deal. He's probably not."  --John Andrews Competitive Webmaster and SEO Blogging at http://www.johnon.com




More information about the talk mailing list