0
votes

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

2
I would suggest looking at stackoverflow.com/questions/21255164/…, it is a question asked a few moments ago but it provides an example of a .htaccess file which will be needed if you are using apachemic
No @micb its not the typical remove index.php thru .htaccess. here is different by using segment in index function. it's not another function im calling it's still index but with segment on it.user2045458

2 Answers

0
votes

With the above config setting

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
0
votes

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]