Error Removing index.php from url (Need Help URGENT Please)

[quote author="GK" date="1278010216"]Noctrum, i've also tried without Default controller by using

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

but this time it is showing (404) other methods.[/quote]

Because you don't have any routes defined, would be looking for the "index" controller.

The default controller only gets called when one isn't provided. Setting the default controller to "HostelSearch" then calling index.php/index won't call HostelSearch/index. You need to use routing for that. Please read the user guide.

$route['index'] = 'HostelSearch/index';
$route['about'] = 'HostelSearch/about';

I guess it was routing to the default controller 'HostelSearch' and not to its default function 'index'. was returning a 404 while or /about was working fine.

Hi All,
to elaborate more, is routing to is routing to

BUT, is NOT routing to
and returning a 404.

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

$route['default_controller'] = 'HostelSearch';

$config['index_page'] = "index.php";
$config['uri_protocol'] = "AUTO";

Any solutions??


You need to keep your default controller out of your .htaccess file. Also note when you change this, you need to clear your browsers cache.
When you say you are getting a 404 error, is a server 404, or a CI 404 error. If it is the latter, you can turn on logging in your config file, and possible see what CI is trying to find.

I would also recommend testing different $config['uri_protocol'] string to the ones that are listed in the config.php file. Perhaps your server is not responding properly to auto.

Thanks pickupman,

here is what error logs say:
DEBUG - 2010-07-01 15:29:42 --> Config Class Initialized
DEBUG - 2010-07-01 15:29:42 --> Hooks Class Initialized
DEBUG - 2010-07-01 15:29:42 --> URI Class Initialized
ERROR - 2010-07-01 15:29:42 --> 404 Page Not Found --> hostelsearch

Controller Name is : HostelSearch

is defined in the routes with correct case.

Any clue?

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

A question: Does the code in the .htaccess file have any special name or is it just Appache settingscode?

I know it provides user override to the server's default settings. The server config is AllowOverride All

It appears to be working correctly or me, but now you need to fix how your created your url's. You should be using something like:
anchor('about_us', 'About Us');
This will take care of the proper way to create links, because if you wanted to change the domain name or add/remove index.php. anchor() will take care of it all.

Also, make sure you have in config.php
$config['site_url'] = '';

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.