Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove index.php from URL in Codeigniter

I have done this lots of time. But than also I am stuck here again (in a different server) and can not figure out what is the issue.

Completed htaccess editing

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /glt.me/CI/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /glt.me/CI/index.php/$1 [L]
</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
  • rewrite module is enabled (as per customer care perons says)
  • Error :

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

Test this case :

http://glt.me/CI/test
http://glt.me/CI/index.php/test
like image 778
TechCare99 Avatar asked Sep 02 '13 10:09

TechCare99


People also ask

What is .htaccess file in CodeIgniter?

htaccess file in CodeIgniter. htaccess is the shortened used for Hypertext Access, which is a powerful configuration file that controls the directory “. htaccess”. It is used by Apache based web servers to control various server features.

Why is index php in my wordpress URL?

The most common reason for index. php appearing is improper permalink structure. Therefore first check if the structure is set properly. To check it, navigate to Settings -> Permalinks.

Where is htaccess file in CodeIgniter?

You should place your . htaccess file at your root directory not Inside the application folder.


1 Answers

This is the simple way and it works fine for removing index.php from your url

RewriteEngine on
RewriteCond $1 !^(index\.php|uploads|css|js|lib|img|bootstrap|robots\.txt)
RewriteRule ^(.*)$ /manage/index.php/$1 [L]

instead of manage put your own application folder name.
like image 76
MJ X Avatar answered Sep 22 '22 10:09

MJ X