简体   繁体   English

重写规则IIS 8,删除.html扩展名

[英]Rewrite rule IIS 8, removing .html extension

I need to add a .html file to a Wordpress installation that works on IIS. 我需要向在IIS上运行的Wordpress安装中添加.html文件。 What I have now is: 我现在所拥有的是:

//mydomain.com/userpage.html //mydomain.com/userpage.html

What I want to achieve is: //mydomain.com/userpage/ 我要实现的是://mydomain.com/userpage/

I fixed all the other rules (pretty urls and so on...) but which code should I use to achieve the above result? 我修复了所有其他规则(漂亮的url等...),但是应该使用哪个代码来实现以上结果?

Thank you! 谢谢!

Max 马克斯

Your rule should be like that: 您的规则应如下所示:

<rule name="hide userpage.html">
    <match url="^userpage/?$" />
    <action type="Rewrite" url="/userpage.html" />
</rule> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM