Reputation: 3873
I hate the codeigniter custom urls where it's: domain.com/controller/action/id
How can I have it like a normal website like: domain.com/controller.php
Anyone know how to disable that?
(using the latest codeigniter)
Upvotes: 1
Views: 2410
Reputation: 529
There is option enable_query_strings in the config.php file, may be that's what you want... You can enable standard query string based URLs by setting this option to TRUE.
Upvotes: 0
Reputation: 16730
If you hate it, you might be not ready to jump in a framework like codeigniter. Rest like urls are a big feature, so the url has some actually meaning, and not just a pointer for something. It's ok if you are used to something like example.com/person.php?id=123&action=seeprofile
, instead of example.com./person/profile/123
but how can't you see the beauty of it? You just should check out some experts explaining why you should do it like that, and why everyone else are doing it like that.
EDIT: You should check this pages of the docs, so you can understand the neat of this great feature.
http://codeigniter.com/user_guide/general/controllers.html#passinguri http://codeigniter.com/user_guide/general/routing.html http://codeigniter.com/user_guide/libraries/uri.html
Upvotes: 3
Reputation: 15251
I don't understand what you are trying to achieve. You may say you 'hate the custom urls' but this actually is a fundamental part of how the framework .. works.
If you really do not like them, then you need to investigate routing, and how this works in the codeigniter context. There is a really, really good argument for not using the controller method id pattern, which I would also support, but this is not it. Internationalisation, for just one thing.
Anyway, adding file.php or my-pro-script.php to the domain name is totally irrelevant for us, the users of your site, who couldn't care less about the .php extension. What's your argument for wanting to do this?
Upvotes: 1
Reputation: 24315
from the CI documentation: http://codeigniter.com/user_guide/general/urls.html
Adding a URL Suffix
In your config/config.php file you can specify a suffix that will be added to all URLs generated by CodeIgniter. For example, if a URL is this:
example.com/index.php/products/view/shoes You can optionally add a suffix, like .html, making the page appear to be of a certain type:
example.com/index.php/products/view/shoes.html
Upvotes: 1