.htaccess - codeigniter remove index.php form url -


i trying remove "index.php" url in codeigniter. know how remove index.php base url example.com/controller.

but don't know how remove "index.php" in sub folder example.com/folder/index.php/controller

because have different projects in codeigniter. second project have uploaded in sub folder.

.htaccess

#original #rewriteengine on #rewritecond $1 !^(index\.php|images|robots\.txt) #rewriterule ^(.*)$ index.php/$1 [l]  #modify rewriteengine on  rewritecond $1 !^(index\.php|resources|robots\.txt)  rewritecond %{request_filename} !-f  rewritecond %{request_filename} !-d  rewriterule ^(.*)$ index.php?/$1 [qsa,l]  rewritebase / rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/$1 [r=301,l] 

the above program base url. change in program work on sub folder.

write code in .htaccess file

# begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /folder/index.php [l] </ifmodule>  # end wordpress 

example : example.com/folder/index.php/contorller

after above code no need write index.php

it's working..


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -