Codeigniter htaccess 不能在 godaddy 上工作?

Codeigniter htaccess not working on godaddy?

我最近搬到了 godaddy Linux 托管,.htaccess 似乎不起作用。是否有任何需要为 godaddy 完成的设置,因为 .htaccess 在本地 xampp 服务器和 hostek server.I 上工作,我收到“404 未找到”错误 message.i 我正在使用 CodeIgniter -2.2.1 框架我还检查了 php.ini 文件中的加载模块中的 mod_rewrite 未找到从服务器端启用。

我的 htaccess 文件位于部署我的应用程序的根目录中。

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

请推荐。

使用这个

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

在config.php

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

编辑 01

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

改变你的

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

喜欢

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

在 Godaddy 上分享的工作:

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

这对我有用:

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