.htaccess - Multiple apps Codeigniter: remove "index.php/controller" from URL -


i new codeigniter , trying understand basics , maybe advance methods set mvc based application. after while thought might try set admin panel , created , second folder admin application.

this folder structure:

www.domain.com     --frontend     --admin 

in each folder app set it's own .htaccess file. bellow .htaccess file admin side.

<ifmodule mod_rewrite.c> rewriteengine on rewritebase /admin/ rewritecond $1 !^(index.php|resources|robots.txt) rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l,qsa]     </ifmodule> 

current working url www.domain.com/admin/index.php/admin/posts , trying pointless change www.domain.com/admin/posts. how remove /index.php/admin url.

the $config['base_url'] set accordingly each side(admin/frontend) , default index.php set null , $config['index_page'] = '';

is problem cause have 2 different apps or bad configuration? best practice multiple applications same site?

hope did not duplicated post , if please don't hate , try me. grateful of you.

try this

in config.php

$config['base_url'] = ''; $config['index_page'] = ''; 

in .htacess

<ifmodule mod_rewrite.c> rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ index.php/$1 [l]  </ifmodule> 

edit 01

<link href="<?php echo base_url(); ?>css/style.css" rel="stylesheet" /> 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -