htaccess/web.config url rewrite from asp to php

.HTACCESS:

<IfModule mod_rewrite.c>
RewriteEngine On

#REWRITE RULES
#———————

#RULE REMOVING .PHP
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond {REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [L]

#RULE ASP CLASSIC LEGACY 301 REDIRECT TO PHP
RewriteCond %{QUERY_STRING} id=([_0-9a-z-]+)
RewriteRule Content\.asp$ %1 [r=301,L]

</IfModule>

 

WEB.CONFIG:

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name=”removing .php” stopProcessing=”true”>
<match url=”^(.*)$” />
<conditions logicalGrouping=”MatchAll”>
<add input=”{REQUEST_FILENAME}” matchType=”IsFile” ignoreCase=”false” negate=”true” />
<add input=”{REQUEST_FILENAME}.php” matchType=”IsFile” ignoreCase=”false” />
</conditions>
<action type=”Rewrite” url=”{R:1}.php” />
</rule>
<rule name=”Asp classic legacy 301 redirect to php” stopProcessing=”true”>
<match url=”Content\.asp$” />
<conditions>
<add input=”{QUERY_STRING}” pattern=”id=([_0-9a-z-]+)” />
</conditions>
<action type=”Redirect” url=”{C:1}” redirectType=”Permanent” appendQueryString=”false”/>
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>