Results 1 to 6 of 6

Thread: Contao 4.4 Server 2016 - IIS

  1. #1
    User
    Join Date
    01-03-18.
    Posts
    31

    Default Contao 4.4 Server 2016 - IIS

    I'm trying to install Contao on Server 2016 with IIS as the hosting service. Is this possible? I've tried with composer, but nothing seems to work. All I get when I try to go to localhost/contao/install is page not found. Is there some re-write rule that I need? Thanks

  2. #2
    User Spooky's Avatar
    Join Date
    01-03-13.
    Posts
    339

    Default

    Yes, look at the provided .htaccess for example. Any request (which is not physically present) will be rewritten to the app.php

  3. #3
    User
    Join Date
    01-03-18.
    Posts
    31

    Default

    Okay, so after doing some more digging around I found this on a site. I'll post it, just in case someone else has the same problem.
    In the web folder you need a web.config file with the following rules
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^app\.php(/(.*)|$)" ignoreCase="false" />
          <action type="Redirect" redirectType="Permanent" url="/{R:2}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url=".?" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
          </conditions>
          <action type="None" />
        </rule>
        <rule name="Imported Rule 3" stopProcessing="true">
          <match url=".?" ignoreCase="false" />
          <action type="Rewrite" url="/app.php" />
        </rule>
      </rules>
    </rewrite>
        </system.webServer>
    </configuration>

  4. #4
    User
    Join Date
    01-03-18.
    Posts
    31

    Default

    Now I'm having another problem though. I can't connect to the database. It's on a different server, everything is set right. I have an older version of contao connected to a different schema and all the rest of the info is the same and it works fine. Any ideas why I can't connect?

    I created a demo of contao 4 on my Mac, it has no issues connecting to the database... All on the same network, trying to connect to the same machine.
    Last edited by sawebdev; 01/05/2018 at 04:28.

  5. #5
    User
    Join Date
    01-03-18.
    Posts
    31

    Default

    Quote Originally Posted by sawebdev View Post
    Okay, so after doing some more digging around I found this on a site. I'll post it, just in case someone else has the same problem.
    In the web folder you need a web.config file with the following rules
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
      <rules>
        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^app\.php(/(.*)|$)" ignoreCase="false" />
          <action type="Redirect" redirectType="Permanent" url="/{R:2}" />
        </rule>
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url=".?" ignoreCase="false" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
          </conditions>
          <action type="None" />
        </rule>
        <rule name="Imported Rule 3" stopProcessing="true">
          <match url=".?" ignoreCase="false" />
          <action type="Rewrite" url="/app.php" />
        </rule>
      </rules>
    </rewrite>
        </system.webServer>
    </configuration>
    So I just updated to 4.4.44 and I can't access the frontend anymore... :| What seems to be happening is if I run a rebuild production cache from the contao manager, it'll stop the site and in developer tools I see that there seems to be some endless loop of the page html.
    So whenever I try to go to the front end it hangs and is in an endless loop...
    I'm thinking it has to do with the web.config, because if I load the page without rewrite rules by going to domain/app.php/home.html it loads, but as soon as I add the Imported Rule 3, it goes into the endless loop.
    Any suggestions or is this some bug?

    UPDATE:
    I'm using IIS with php 7.2. I did a complete fresh install and as soon as I create some home page and try to access it, it just goes into this loop... Installed with no errors... Really confusing
    Last edited by sawebdev; 10/02/2019 at 19:50.

  6. #6
    User
    Join Date
    01-03-18.
    Posts
    31

    Default

    I finally figured it out! :D It was a template error... Some template that I had edited, though don't see any edit that I made in the older template, but some changes made it so that the front end wouldn't properly load. :D

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •