I have here an .htaccess file that I need to convert to a web.config for use with Azure. Here is the htaccess file:
Options +FollowSymlinks
Options -Multiviews
ErrorDocument 404 /error-404
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [NC,L]
I have already converted this to a web.config file, but it does not work. It just throws a 404 error not found. Here is the web.config:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="rule 1C" stopProcessing="true">
<match url="!.*\.php$" ignoreCase="true" />
<action type="Rewrite" url="/%REQUEST_FILENAME}.php". />
</rule>
</rules>
</rewrite>
<defaultDocument>
<files>
<add value="test.php" />
</files>
</defaultDocument>
</system.webServer>
</configuration>
Everything about this file works except the rewrite. Just need help getting the pages to show up without the .php file extension in Azure.
Aucun commentaire:
Enregistrer un commentaire