Vasil Dakov
Vasil Dakov

Reputation: 2039

Codeigniter, OpenID and .htaccess

I'm trying to use Codeigniter OpenID library and everything work fine with default configuration of CI without .htaccess.

When I remove index.php by changing config.php and .htaccess I get 404 Page Not Found when I try to verify my openid (http://ci.dlsb.eu/test/)

Can anybody tell me where I'm wrong?

config.php

$config['index_page'] = "";

.htaccess

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

Upvotes: 5

Views: 787

Answers (1)

Tim Stone
Tim Stone

Reputation: 19169

Your RewriteRule attempts to create PATH_INFO in a per-directory context, which, from what I can tell, occurs too late in the request processing phase to work correctly.

The best solution is to simply not do this, as CodeIgniter doesn't require it to function:

RewriteEngine on
RewriteBase /
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php

CodeIgniter should be able to figure out what the proper request was on its own, provided that you left $config['uri_protocol'] set to AUTO. If not, you should set it to either AUTO or to REQUEST_URI.

Upvotes: 5

Related Questions