0

How can i remove index.php from url in codeingnator.

I have changed in config page from $config['index_page'] = 'index.php' to
$config['index_page'] = ''.

But I dont know ,where i can add .htaccess file?

3
  • It means that you want to add default page Commented Nov 21, 2019 at 7:00
  • I want to add inside application folder or inside codeingnator folder? @Ibnelaiq Commented Nov 21, 2019 at 7:03
  • root of your application you will find .htaccess file edit it and add lines below Commented Nov 21, 2019 at 7:07

3 Answers 3

2

Need to change config file : '$config['base_url'] = ''; $config['index_page'] = ''; htaccess file :

<IfModule mod_rewrite.c> 
RewriteEngine On 
#RewriteBase /     
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^ index.php [QSA,L] 
</IfModule>
Sign up to request clarification or add additional context in comments.

Comments

2

Re-write htaccess file with the following code.

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

you could found more information Here

Comments

1

add this lines to .htaccess file

  RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$1 [PT,L]

check codeigniter documention

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.