(Não tenho certeza se essa é a área exata para essa pergunta, mas foi o mais conveniente que eu achei..)
Seguinte, minha empresa comprou um site em php, temos uma hospedagem Windows com IIS 7.5... estou tentando converter os arquivos .htaccess do apache para Web.Config, porém estou tendo um problema:
Tenho o seguinte .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.py?url=$1 [nc]
AddType application/x-httpd-php .py
DirectoryIndex index.py
E este é o meu web.config até agora:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteRule" stopProcessing="true">
<match url="^(.*)$" ignoreCase="false" />
<conditions>
<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="index.py?url={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<remove value="index.py" />
<add value="index.py" />
</files>
</defaultDocument>
<handlers>
<add name="MaskPyAsPHP" path=".py" verb="GET,HEAD,POST,DEBUG" modules="FastCgiModule" /> //i'm not sure about this line
</handlers>
</system.webServer>
<system.web>
<customErrors mode="Off"></customErrors>
<compilation debug="true"></compilation>
</system.web>
<system.data>
<DbProviderFactories>
<clear />
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=5.1.54.5, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>
</system.data>
</configuration>
A Index do site é index.py só que não python, só tem código php, acredito que apenas mudaram a extensão, porém é justamente isso que não estou conseguindo configurar no Web.Config... apartir da
configuração atual eu tenho a seguinte mensagem:
HTTP Error 404.3 - Not Found
The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map.
Já pesquisei e li vários links mas to estou entendo como adicionar o HttpHandler...
Obrigado!
Ao infinito e além!
twitter
@elzacky