Configure web.config file for PHP project in subdirectories

0

I have a site in php under test in a directory above the root of the official website. To set up friendly URLs ( remove .php ) is by web.config . I made a rule that does not work for subdirectory files. Ex: products / something and product / something , only works on root company.php files. When accessing the product and product pages you get the message "No input file specified."

link = OK

link = No input file specified.

With the php extension it works normalmnte: link

    
asked by anonymous 28.06.2017 / 17:34

1 answer

1

I was able to solve it this way: (with asterisks after the slash)

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="rule 1p" stopProcessing="true">
                    <match url="^([a-z0-9-]+)/*"  ignoreCase="true" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />  
                    </conditions>
                    <action type="Rewrite" url="/sitenovo/{R:1}.php/*" appendQueryString="false" />
                </rule>

            </rules>



        </rewrite>
    </system.webServer>
</configuration>
    
10.07.2017 / 18:33