iSa
iSa

Reputation: 1153

GoDaddy .htaccess not working

I've develop a site in my computer using xampp and flight php and everything works just fine. I decided to upload it in godaddy using windows plesk account and when I try to access my site, it produces 404 error. I know the index.php was executed but the rewrite is not working. Ex. when I access mysite.com/login, it produces 404 error. I used the default flight php htaccess.

RewriteEngine On
RewriteBase /httpdocs/uem-um-gov.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

Upvotes: 0

Views: 1408

Answers (1)

iSa
iSa

Reputation: 1153

I figure out that the server is using IIS and not apache, so I replaced my .htaccess with the Web.config equivalent.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <clear />
                <rule name="Rewrite to index.php" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php" appendQueryString="true" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Upvotes: 1

Related Questions