Welcome Guest, Not a member yet? Register   Sign In
Hide index.php from URL
#1

[eluser]ibnclaudius[/eluser]
My website:

http://ibnight.com

When trying to access an event in my website by:

http://ibnight.com/1

I get a not found error:

Quote:The requested URL /1 was not found on this server.

Works only if I access it with the index.php in url, like:

http://ibnight.com/index.php/1

My controller is something like:

Code:
class Events extends CI_Controller {

    public function __construct()
    {}

    public function index()
    {}

    public function event()
    {}

}

My routing:

Code:
$route['default_controller'] = 'events';
$route['(:num)'] = $route['default_controller'] . '/event/$1';

My config:

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

My .htaccess:

Code:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
#2

[eluser]ibnclaudius[/eluser]
I've also tried:

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

But the error persists...
#3

[eluser]TheFuzzy0ne[/eluser]
Try replacing this:
Code:
RewriteRule ^(.*)$ index.php/$1 [L]

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

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




Theme © iAndrew 2016 - Forum software by © MyBB