only M
only M

Reputation:

MVC in Codeigniter Framework

I have seen in sites which were built using CodeIngniter framework there there is 'index.php' in the URI. Is that necessary?.

For example: example.com/index.php/products/view/shoes

Is it possible to make it:

example.com/products/view/shoes

Upvotes: 3

Views: 120

Answers (3)

Juan Jo
Juan Jo

Reputation: 892

of course, you have to rewrite the routes with an .htaccess, here it is

Upvotes: 2

mitchellhislop
mitchellhislop

Reputation: 445

Yes, and here is where the directions are

Upvotes: 1

Jarrod Nettles
Jarrod Nettles

Reputation: 6293

Sites like this are making use of "mod_rewrite", a module for Apache. So long as mod_rewrite is installed on your web server, you can set htaccess rules that route a web request like /products/view/shoes through index.php (or whatever page you want). URL rewriting is a large topic with many facets and you'll be able to learn more through some Google searches.

Apache's URL Rewriting Guide

IIS Equivalent of mod_rewrite

Upvotes: 1

Related Questions