CodeIgniter Forums
Error establishing a database connection with htaccess - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Error establishing a database connection with htaccess (/showthread.php?tid=18938)



Error establishing a database connection with htaccess - El Forum - 05-22-2009

[eluser]earlyriser[/eluser]
I had some trouble configuring the htaccess file for non-index.php urls in a subfolder. Here is the solution.

PROBLEM:
CI fresh installation in a subfolder. Everything is fine but when the htaccess file is uploaded as specified in http://ellislab.com/codeigniter/user-guide/general/urls.html an "Error establishing a database connection" message is prompted.

SOLUTION:
Try this code found in http://opinionatedcoder.wordpress.com/2008/05/19/codeigniter-tutorial-part-2-htaccess/

Code:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]


That's all.


Error establishing a database connection with htaccess - El Forum - 05-22-2009

[eluser]Dam1an[/eluser]
Wow, I completely forgot about my old blog (It kind of died when it came around to exams, and then a job) glad people still find it useful Smile

Just checked the WP CP, and somehow, that blogs now getting more traffic then when I was posting on it (Might start it up again)