How i Solve problems on IIS (500 and 404)

  1. install php 5.6 - mautic supported use guide on php.net
  2. enable all extensions and use php.ini-production (you can disable some extesions after start)



    3.you need import .htaccess file
Code:
RewriteEngine On
RewriteCond %{HTTP:Authorization} .+
RewriteRule .* - [HTTP_AUTHORIZATION:%{HTTP:Authorization}]


RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::2$
RewriteRule ^(.*) - [BASE:%1]


RewriteCond %{REDIRECT_STATUS} ^$
RewriteRule ^index.php(/(.*)|$) %{BASE}/$2 [R=301,L]


RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]

# Rewrite all other queries to the front controller.
RewriteRule .? %{BASE}/index.php [L]

<IfModule !mod_rewrite.c>

    RedirectMatch 302 ^(?!/(index.php|index_dev.php|app|addons|plugins|media|upgrade))(/(.*))$ /index.php$2
   
</IfModule>


or use my web.config file on mautic folder
Code:
<?xml version="1.0" encoding="UTF-8"?>
</system.webServer>

before change this settings i was 500 errors and 404
  1. install php 5.6 - mautic supported use guide on php.net
  2. enable all extensions and use php.ini-production (you can disable some extesions after start)

3.you need import .htaccess file

<IfModule mod_rewrite.c>
    RewriteEngine On

   
    RewriteCond %{HTTP:Authorization} .+
    RewriteRule .* - [HTTP_AUTHORIZATION:%{HTTP:Authorization}]

   
    RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::2$
    RewriteRule ^(.*) - [BASE:%1]

    
    RewriteCond %{REDIRECT_STATUS} ^$
    RewriteRule ^index.php(/(.*)|$) %{BASE}/$2 [R=301,L]

  
    RewriteCond %{REQUEST_FILENAME} -f
    RewriteRule .? - [L]

    # Rewrite all other queries to the front controller.
    RewriteRule .? %{BASE}/index.php [L]
</IfModule>

<IfModule !mod_rewrite.c>
    <IfModule mod_alias.c>
       
        RedirectMatch 302 ^(?!/(index.php|index_dev.php|app|addons|plugins|media|upgrade))(/(.*))$ /index.php$2
       
    </IfModule>
</IfModule>

or use my web.config file on mautic folder

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <handlers>
            <add name="FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:phpphp-cgi.exe" resourceType="Either" requireAccess="Script" />
        </handlers>
        <defaultDocument>
            <files>
                <add value="index.php" />
            </files>
        </defaultDocument>
        <rewrite>
            <rules>
                <rule name="Импортированное правило 1">
                    <match url=".*" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{HTTP_AUTHORIZATION}" pattern=".+" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Импортированное правило 2">
                    <match url="^(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{URL}::{R:1}" pattern="^(/.+)/(.*)::2$" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Импортированное правило 3" stopProcessing="true">
                    <match url="^index.php(/(.*)|$)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REDIRECT_STATUS}" pattern="^$" ignoreCase="false" />
                    </conditions>
                    <action type="Redirect" url="{BASE}/{R:2}" redirectType="Permanent" />
                </rule>
                <rule name="Импортированное правило 4" stopProcessing="true">
                    <match url=".?" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
                    </conditions>
                    <action type="None" />
                </rule>
                <rule name="Импортированное правило 5" stopProcessing="true">
                    <match url=".?" ignoreCase="false" />
                    <action type="Rewrite" url="{BASE}/index.php" />
                </rule>
            </rules>
        </rewrite>
       
    </system.webServer>
    
</configuration>

before change this settings i was 500 errors and 404

Hi,

I see your post from 2016 so thanks!

Is it still the same code today for newer 4.XX versions?

Thanks