Reputation: 65
I have this link
localhost/MySite/queues/index.php
index.php has been removed using .htaccess and I got URL as follows.
localhost/MySite/queues
Now the problem is, when I use segment in my index function like this:
queues.php --> controller
function index($sgmnt = 'test'){
$this->load->view('queues_view/'.$sgmnt);
}
I want to have this link
localhost/MySite/queues/test
NOT
localhost/MySite/queues/index.php/test
or I can still type
localhost/MySite/queues/index.php/test
but URL must show only
localhost/MySite/queues/test
Upvotes: 0
Views: 119
Reputation: 105
for this you can take advantage of htaccess.open htaccess and add these lines in to that. i hope it will work(http://localhost/MySite/queues/test
).
RewriteEngine On
RewriteRule ^MySite/queues/test$ /MySite/queues/index.php [L]
Upvotes: 0
Reputation: 1549
With the above config setting
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
Upvotes: 0