Appache rewrite rules in htaccess file

I am working in a project where we use codeigniter.

If user goto link then my router look like is

$route['product'] = "product/all_product";

If they click any category say computer the (s)he will redirect to and my router is

$route['category/(:any)'] = "product/category_product/$1"; //$1 = computer or electronics

How to do that using .htaccess file?


@SKG - the url for your codeigniter site will be You can (and most people do) remove the index.php, so the default url is simply

from there, if you have a controller Category with an index($var) function, you can access it via:

if you have an existing page at and you would like it to go to - perhaps because that link is already "out in the wild" in many places and so you want to redirect people to the new url, then you'll want to do the redirect where the computer.html file is and then remap, as shown here:

Need Your Help

search gridview with objectdatasource

I have this procedure for performing the search:

Why use javascript callbacks when cleaner syntax is available?

javascript node.js syntax callback code-readability

I'm trying to learn to use Node. So far, so good. But, being pretty new to JavasSript and I don't really get the point of using callbacks when a cleaner and more readable (at least to me) syntax is

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.