How to active URL mod_rewrite

What is URL mod_rewrite

mod_rewrite is re write your original url to customize url.

Why we need URL Rewrite

We use this for user to read easily and understandable. This is most important part of SEO.

Example :

Http://yourdomain.com/categoryid=1&subcategory=3  this kind of URL can not identify anything looking the url.  but using mod_rewrite the url can change as below.

http://yourdomain.com/information/webdesign/

This is very useful who are looking for rank your web site on the web.

How to active and do it 

first create file name like “.htaccess” , after that open it with text editor and write flowing text.

//active mod_rewrite
RewriteEngine on

Example :
http://www.yourdomain.com/shop.php?type=product&category=vehicles&product=bus

mod_rewrite code in .htaccess

//active mod_rewrite
RewriteEngine on

RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /shop.php?cmd=$1&category=$2&product=$3 [L]

after url mod_rewrite
http://www.domain.com/shop/vehicles/bus.html

 

use this link to generate your mod_rewrite code.
http://www.generateit.net/mod-rewrite/index.php 

Be the first to comment

Leave a Reply

Your email address will not be published.


*