1

I installed symfony2 framework on an IIS server.

When I type http://localhost/myAlias/app_dev.php, it works fine, my routing is sending me on http://localhost/myAlias/app_dev.php.

When I type http://localhost/myAlias implicitly app.php, I receive No route found for "GET /myAlias" and all my dependencies files (css/js), point to http://localhost/bundles/file.js

It looks like Symfony2 is getting the base Url wrong, without the /myAlias in it. But I read somewhere IIS works fine without the equivalent of Rewritebase /myAlias for Apache

My IIS web.config

<system.webServer>
        <defaultDocument enabled="true">
            <files>
                <add value="app.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="call app.php" enabled="true" stopProcessing="true">
                    <match url="^(.*)$" />
                    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
                    </conditions>
                    <action type="Rewrite" url="app.php" />
                </rule>
            </rules>
        </rewrite>
</system.webServer>

Did I forget to check a box ?

1 Answer 1

0

Have your tried clearing the cache in the prod environment? Try the following command:

Symfony 2.8-

php app/console cache:clear --env=prod --no-debug

Symfony 3.0 +

php bin/console cache:clear --env=prod --no-debug

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.