Welcome Guest, Not a member yet? Register   Sign In
Removing index.php from the URL's
#1

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?
Reply
#2

(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]
Reply
#3

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.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

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

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

(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.
Reply
#6

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.
Reply
#7

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]
Reply




Theme © iAndrew 2016 - Forum software by © MyBB