htaccess friendly URL does not work in Plesk?

Asked

Viewed 210 times

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 is being ignored. When I used the Linux server it worked well.

Any suggestions?

  • 1

    here’s what you need https://forum.imasters.com.br/topic/494021-arquivo-htaccess-em-servor-windows/

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>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.