Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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]
like image 516
Vasil Dakov Avatar asked Jul 20 '10 12:07

Vasil Dakov


1 Answers

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.

like image 189
Tim Stone Avatar answered Sep 24 '22 14:09

Tim Stone