Sameek Mishra
Sameek Mishra

Reputation: 9404

Codeigniter htaccess not working on godaddy?

I recently moved to godaddy Linux hosting and the .htaccess doesn't seem to work. Are there any settings which need to be done for godaddy because the .htaccess was working on local xampp server as well as hostek server.I am getting "404 Not Found" error message.i am using CodeIgniter-2.2.1 framework also i have check mod_rewrite in Loaded Modules in php.ini file was not found enable from server side .

My htaccess file located on root directory where my application is deployed.

RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

Please suggest.

Upvotes: 1

Views: 4021

Answers (5)

Ujjwal Chawla
Ujjwal Chawla

Reputation: 1

<ifmodule mod_rewrite.c>

  # !IMPORTANT! Set your RewriteBase here and don't forget trailing     and leading
  #  slashes.
  # If your page resides at
  #  http://www.example.com/mypage/test1
  # then use
  # RewriteBase /mypage/test1/

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /path_to/your_website/index.php?$1 [L,QSA] 
</IfModule>

Upvotes: 0

Sameek Mishra
Sameek Mishra

Reputation: 9404

This is work for me:

RewriteEngine On
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Upvotes: 1

Tpojka
Tpojka

Reputation: 7111

Working one on Godaddy shared:

RewriteEngine on
RewriteBase /
Options -Indexes
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/\?$1 [L]

Upvotes: 0

Abdulla Nilam
Abdulla Nilam

Reputation: 38652

use this

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L] 
</IfModule>

in config.php

$config['base_url'] = "";
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";

EDIT 01

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

Upvotes: 0

Yes Kay Selva
Yes Kay Selva

Reputation: 584

change your

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

to like

RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

Upvotes: 0

Related Questions