Welcome Guest, Not a member yet? Register   Sign In
Userfriendly urls without moderewrite?
#1

[eluser]olof84[/eluser]
Hi! I a, trying to learn Codeigniter, but one questions puzzles me, and I have not yet found it´s answer.

How come Codeigniter framework can read userfriendly urlConfused if it do not use moderewrite? I see no .htacess file in the main root, and only 1 in the applications folder; but that one only contains 1 row.

I guess my question is this: can CodeIgniter somehow write userfriendly urlConfused and interpret it without moderewrite? If so, how?

I apologize for my noob question.
#2

[eluser]Tpojka[/eluser]
Read user manul on this page if that can solve your issue.
#3

[eluser]olof84[/eluser]
I am not sure how that answers my question.

Perhaps I should specify my question better. How can CI can read a URI with PHP, and direct it to specific files?

For example, if I write the URI mysite.com/blog/article/5 a normal webbserver domain without moderewrite will try to find a folder called blog; which should have an subfolder called article. But CI projects do not seem to be built this way. CI seem to redirect the URI to specific files, just like the PHP layer moderewrite does. But how CI do it without moderewrite puzzles me.

EDIT: Maybe I got it now, correct me if I am wrong. It seems like my webbrowser begin by reading index.php, no matter what I write after index.php/. So by first reading index.php CI can check what the following segments are, and then redirect the user to the right file.
#4

[eluser]Massaki[/eluser]
.htaccess redirects all to index.php, unless you define other rules.
Then, index.php loads all the CodeIgniter mechanisms to segregate URI to controller, method and arguments.
If you define something else in routes.php, you can simplify url or hide controller/method names.




Theme © iAndrew 2016 - Forum software by © MyBB