0
我在这里有一个.htaccess文件,我需要将其转换为用于Azure的web.config。这里是htaccess文件:将.htacess转换为适用于Azure的web.config
Options +FollowSymlinks
Options -Multiviews
ErrorDocument 404 /error-404
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [NC,L]
我已经将其转换为web.config文件,但它不起作用。它只是抛出404错误未找到。这里是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>
有关此文件的一切工作,除了重写。只需要帮助让页面在Azure中没有.php文件扩展名的情况下显示即可。