htaccess friendly URL does not work in Plesk?

0

I created the file .htaccess and included it in the root of my site with the following code:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ teste.php?u=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ teste.php?u=$1

But it's being ignored. When I used the Linux server it worked fine.

Any suggestions?

    
asked by anonymous 10.10.2017 / 16:22

1 answer

0

The solution is to change the file web.config :

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    <rewrite>
    <rules>
        <rule name="exemplo 1" stopProcessing="true">
        <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
        </conditions>
        <match url="^(.*)$" ignoreCase="true" />
        <action type="Rewrite" url="teste.php?url={R:1}" appendQueryString="true" />
        </rule>
    </rules>
    </rewrite>
    </system.webServer>
</configuration>
    
10.10.2017 / 17:18