Reputation: 205
Good day.
I set up a website and here's the link:
http://xactosdatosinc.com/ci/codeigniter
In my local PC, I setup a .htaccess file to have a clean URL which is working. When I uploaded it in Godaddy, I can view the login page. But when I tried to login, it says, Error 404.
I search a lot of variations of .htaccess but no success at all. Actually, here's mine:
RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)`
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
At one point, I realized that in my local PC, I am using an Apache server thats why .htaccess
is working. In Godaddy, I believe, .htaccess
is not recognized. It is web.config
that is being used in their ISS webserver.
My issue now is how can I translate this .htaccess
to web.config
which I hope works in Godaddy hosting?
Many thanks in advance...
Upvotes: 0
Views: 1363
Reputation: 143906
First result on google: 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>
Upvotes: 1