CodeIgniter Forums
Removing index.php from the URL's - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: Removing index.php from the URL's (/showthread.php?tid=66103)



Removing index.php from the URL's - harry_ord - 09-05-2016

Hello

 I'm following the user guide included with Code Igniter and i'm trying to remove the index.php from the URLs just how it's pointed in the guide. I do this in the .htaccess file:

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


mod rewrite is enabled too, but it doesn't seem to work.

Is something missing?


RE: Removing index.php from the URL's - leandrosnx - 09-05-2016

(09-05-2016, 03:42 PM)harry_ord Wrote: Hello

 I'm following the user guide included with Code Igniter and i'm trying to remove the index.php from the URLs just how it's pointed in the guide. I do this in the .htaccess file:

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


mod rewrite is enabled too, but it doesn't seem to work.

Is something missing?

This work's for me:
Code:
RewriteEngine on
RewriteRule ^uploads\/videos/(.*) site/check/ [L]

RewriteCond $1 !^(images|css|js|uploads|index\.php|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA]



RE: Removing index.php from the URL's - InsiteFX - 09-06-2016

Here we go again! 

NOTE: If your html file is correct and you use the base_href parameter you do not need this line in your .htaccess file.

Code:
RewriteCond $1 !^(images|css|js|uploads|index\.php|robots\.txt)

This line can cause you problems in your .htaccess file later down the road.


RE: Removing index.php from the URL's - dimawebmaker - 09-08-2016

Code:
$config['index_page'] = '';

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



RE: Removing index.php from the URL's - harry_ord - 09-22-2016

(09-08-2016, 06:40 AM)dimawebmaker Wrote:
Code:
$config['index_page'] = '';

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

 I already have it like that and it's not working. I'm using PHP 7.0 on xampp.


RE: Removing index.php from the URL's - mwhitney - 09-26-2016

Try changing the index.php line to this:

Code:
RewriteRule ^(.*)$ index.php?/$1 [L]

Depending on the version and configuration of Apache (and where you set the rule, and maybe a dozen other variables), you may need the question mark after index.php.


RE: Removing index.php from the URL's - harry_ord - 09-26-2016

I made a fresh installation and i used the solution proposed by dimawebmaker and now i totally worked. Thanks!


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