Hello dear readers.
In this tutorial i will explain in deepth how to make your url's beautiful and better for seo.
Lets take an example:
Non rewrited url:
http://facebook.com/profile.php?id=12324231
Rewrited url:
http://facebook.com/PhpTutorials
Cool isnt it ?
2) Security
mod_rewrite is build in security
You can use some kind of filters who allow only 0-9 or a-z etc.. by not allowing dangerous charachters
Now at root open or create .htaccess if you havent it
Lets for example rewrite the profile.php url:RewriteEngine On
RewriteBase /
RewriteRule ^profile/([a-zA-Z0-9-!./]+).html$ profile.php?id=$1
In this tutorial i will explain in deepth how to make your url's beautiful and better for seo.
Benefits of mod_rewrite:
1) they are beautifulLets take an example:
Non rewrited url:
http://facebook.com/profile.php?id=12324231
Rewrited url:
http://facebook.com/PhpTutorials
Cool isnt it ?
2) Security
mod_rewrite is build in security
You can use some kind of filters who allow only 0-9 or a-z etc.. by not allowing dangerous charachters
Lets move on
To make mod_rewrite work we must go to apache http.conf and add this line:LoadModule rewrite_module modules/mod_rewrite.soThen restart apache.Now at root open or create .htaccess if you havent it
Lets for example rewrite the profile.php url:RewriteEngine On
RewriteBase /
RewriteRule ^profile/([a-zA-Z0-9-!./]+).html$ profile.php?id=$1
Wow nice tutorial..!
ReplyDelete