February 1, 2012

Codeigniter .htaccess issue on PHP-CGI, WebHero Hosting

Codeigniter .htaccess issue on PHP-CGI, WebHero Hosting

.htaccess part will be:

RewriteEngine On
RewriteBase /

RewriteCond %{ENV:REDIRECT_APP_PATH} !^$
RewriteRule ^(.*)$ – [E=APP_PATH:%{ENV:REDIRECT_APP_PATH}]
RewriteCond %{ENV:APP_PATH} ^$
RewriteRule ^(.*)$ – [E=APP_PATH:/$1]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [L]
Codgienter Part (config.php):

$config[‘uri_protocol’]    = “APP_PATH”;//’REQUEST_URI’;

 

Last updated: March 19, 2014
Did it helped? 2 thoughts on “Codeigniter .htaccess issue on PHP-CGI, WebHero Hosting
  1. Clairouneg

    Thank you. Thank you. THANK YOU.Worked like a charm. Knew it wroked immediately b/c I was able to update WordPress, which had previously refused to update automatically.One small note: For me, when I looked at the Hosting Control Center, I saw 2 lines. The first said ?Extension -> .php | Runs Under -> PHP 4.x?. The second said ?Extension -> .php5 | Runs Under -> PHP 5.x?. So for me, I did the following, based on your instructions above, with my changes noted between the **_**: – Back in the Hosting Control Center, click on Settings, then File Extension. If the change to 5.x has been completed, you?ll see at the bottom of the available extensions list, ?Extension -> .php**5** | Runs Under -> PHP 5.x? If it?s not there, stop here and come back in an hour or so.Click on Custom Extensions at the left. This should be empty, with a message stating ?No custom extensions have been created.?Click on Default Extensions and then click on the Edit button (it looks like a piece of paper and a pencil) to the right of .php | PHP **4**.x. Click on Continue. **In the dropdown box, change PHP4.x to PHP 5.x.**Click again on the Custom Extensions button on the left, and you should now see ?Extension -> .php | Runs Under -> PHP 5.x?. Check your phpinfo page one more time, and it should report PHP 5.x. -THANK YOU. Your instructions were a HUGE help.

  2. douglas dias

    Using $config[‘uri_protocol’] = ‘REQUEST_URI’;
    worked fine for me thanks

Comments are closed.