0

I am moving a PHP application from Apache to IIS server. I am trying to translate the following .htaccess rule:

RewriteEngine On
RewriteRule ^(.*)$ public/$1?%{QUERY_STRING} [QSA,L]

It simply redirects all requests (as well as query string) to public subdirectory.

I have tried something like the following in web.config file-

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <rewrite>
        <rules>
            <rule name="Root Hit Redirect" stopProcessing="true">
                <match url="^$" />
                <action type="Redirect" url="/public/index.php" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>
</configuration>

But it keeps falling into redirect loop. What should be correct web.config rule in this case?

1 Answer 1

0

Managed to solve this by importing rules in IIS.

http://akrabat.com/winphp-challenge/zend-framework-url-rewriting-in-iis7/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.