Mike Spider
Mike Spider

Reputation: 227

HTACCESS works in localhost but not in remote host

I know this has been asking many times, but none of the solutions I tried worked. All this works fine in my localhost. But after I uploaded on a remote host all controller links need the "index.php/" pre-appended to them in order for them to work.

htaccsess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 

the .htaccess file is in the CI root folder.

my config:

$config['base_url'] = "http://".$_SERVER['SERVER_NAME']."/";
$config['index_page'] = "";
$config['uri_protocol'] = 'AUTO';

I already tried changing the uri_protocol to "REQUEST_URI" and "ORIG_PATH_INFO", still no joy. I heard that there's a step involving setting up the httpd.conf file and changing the "AllowOverride " to "ALL". But I guess I have no access to the httpd.conf in the remote server(shared).

Any help will be much appreciated.

Upvotes: 0

Views: 1110

Answers (1)

Uzi Balooch
Uzi Balooch

Reputation: 50

 Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

#RewriteEngine on
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule .* index.php/$0 [PT,L]  

Works for me on local as well as on remote ..

Upvotes: 2

Related Questions