1

I am trying to redirect my domain.com to domain.com/index. I tried both via route.php and httaccess. but not working.

route.php

$route[''] = "front_controllers/home/home_controller/index";
$route['index'] = "front_controllers/home/home_controller/index"; 

httaccess file

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ index [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

I past i added some rules in htaccess to remove "index.php" of codeIgniter.

I want to load my homepage which is on "index" on loading of domain.com

i already removed index.php , problem is i unable to access localhost/codeIgniter it gives 404 error

localhost/codeIgniter/index working fine as shown in route.php

10
  • Did you add your base url in config.php? Commented Jan 18, 2018 at 5:05
  • @SaiDeepak yes its localhost/codeIgniter Commented Jan 18, 2018 at 5:08
  • @SaiDeepak yes, $config['base_url'] = 'localhost/codeIgniter'; Commented Jan 18, 2018 at 5:10
  • Just Try Renaming the controller file -> First letter to capital letter. Since nowadays Code igniter does that. Commented Jan 18, 2018 at 5:22
  • @SaiDeepak no, not working Commented Jan 18, 2018 at 6:53

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.