我读到.htaccess不能在像godaddy这样的Windows服务器上工作。因此,要隐藏或删除喜欢的扩展名为.php和.html的网址,你可以用下面的代码创建一个web.config文件实现这一点:隐藏/删除Windows服务器的URL扩展
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="RewriteHTML">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions> <action type="Rewrite" url="{R:1}.html" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我试图让web.config文件并将其保存在那里的index.php是与代码,但什么也没发生。我与测试它像这样
<ul>
<li>
<a href="attackontitan-3">Attack on Titan Episode 3</a>
</li>
</ul> with a href of "attackontitan-3"
我想要的网址是http://mysite/watching/attack%20on%20titan/attackontitan-3不http://mysite/watching/attack%20on%20titan/attackontitan-3.php