Hi everyone I am having a problem in setting up the .htaccess URL fix for CodeIgniter Framework.
I have a site launched in a folder named "sites".
=> THE PROBLEM:
**This URL works perfectly:
http://127.0.0.1/sites/home/index/test
I want to get rid of /index/ from the URL
The destination URL should be like this:
http://127.0.0.1/sites/home/test
How can i acheive this URL?
Additional Info:
I have URL helper in autoload done which works great and here is the code in My Controller
class Home extends CI_Controller {
public function index($var='')
{
echo $var; //outputs -> test
}
}
.htaccess
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteBase /sites
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
RewriteRule ^(.*)$ index.php/$1 [L]