0

再会。

我建立了一个网站,这是链接:

http://xactosdatosinc.com/ci/codeigniter

在我的本地 PC 中,我设置了一个 .htaccess 文件以拥有一个正常工作的干净 URL。当我上传到 Godaddy 时,我可以查看登录页面。但是当我尝试登录时,它显示错误 404。

我搜索了很多 .htaccess 的变体,但根本没有成功。实际上,这是我的:

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

有一次,我意识到在我的本地 PC 中,我使用的是 Apache 服务器,这就是为什么.htaccess它可以工作。在 Godaddy,我相信,.htaccess是不被认可的。就是web.config在他们的 ISS 网络服务器中使用。

我现在的问题是如何将它翻译.htaccessweb.config我希望在 Godaddy 托管中工作的内容?

提前谢谢了...

4

1 回答 1

1

谷歌上的第一个结果:http ://www.iis.net/learn/application-frameworks/install-and-configure-php-applications-on-iis/translate-htaccess-content-to-iis-webconfig

<rewrite>
  <rules>
    <rule name="htaccess codeigniter rule" stopProcessing="true">
      <match url="^(.*)$" ignoreCase="false" />
      <conditions>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="^/index.php" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="^/resources" ignoreCase="false" negate="true" />
        <add input="{URL}" pattern="^/robots.txt" ignoreCase="false" negate="true" />
      </conditions>
      <action type="Rewrite" url="index.php?/{R:1}" appendQueryString="true" />
    </rule>
  </rules>
</rewrite>
于 2013-09-26T06:03:47.490 回答