0

I am trying to convert htaccess to webconfig but am receiving errors.

This is my htaccess

Options -MultiViews -Indexes

# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1

# Remove www from url
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]

RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

My web config

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
             <rules>
                <rule name="rule 1">
                    <match url="^(.*)$"  />
                    <action type="Rewrite" url="/index.php?url={R:1}"  />
                </rule>
                <rule name="rule 2" stopProcessing="true">
                    <match url="^"  />
                    <action type="Rewrite" url="/https://%1%{REQUEST_URI}"  />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

The error I get is not specific and just says runtime error.

Is there an error in my xml? I have no access to the server to do a import or conversion there.

badsyntax
  • 311
  • 4
  • 14

0 Answers0