Friday, January 9, 2009

mod_rewrite Can we use like protocetcion

I am wondering is good to use mod_rewrite for my web pages hmm...

Some of readers on Digg write :
url rewriting is old
google don' t care for your url format
in 1998 friendly was good now is waste of time

But i found more useful function in mod_rewrite

simple normal url : index.php?newsid=1

newsid can be string ,charter, integer or special character

that is very big problem because somebody can write index.php?newsid= ?????
some mysql injection code .

of course we wrote sql protcetion code in php.

but if we don't or we don't like to waste time on hacker
or we like to be url friendly we can use mod_rewrite

simple url : .../1/title-of-article.html

we have only one parameter here and one title in url is good for SEO
and one more good staff if client(user) write /???/title-of-article.html
will get error page 404.
Why because url must be in format /number(0-9)+/string


No comments:

Post a Comment