对于大型站点中的许多页面,实现批量301重定向的最佳方式是什么,以便只将以.html结尾的页面移动到页面名称文件夹?我使用的是Windows Server 2016。
例如:
product56/download.html > product56/download/
product56/user-manual.html > product56/user-manual/
但是,如果指定了index.html,则不应重定向到文件夹,而应重定向到根目录,例如:
product47/index.html > product47/
然后,我还有大约300个单独的aspx页面需要重定向到自定义URL,例如:
购物车/label-software-P590.aspx> products/label-software/niceware/
发布于 2020-01-10 15:38:47
在我看来,你可以使用IIS重写来达到你的要求,你可以从这个url下载它。
product56/download.html > product56/download/ product56/user-manual.html > product56/user-manual/
Url重写包含友好的url,您可以使用它来满足您的要求。您可以参考本文的详细信息:
https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/user-friendly-url-rule-template
对于指定的html,您应该自己编写自定义url。
例如:
product47/index.html > product47/
<rewrite>
<rules>
<rule name="inde" stopProcessing="true">
<match url="product47/index.html" />
<action type="Redirect" url="http://yourdomian/product47/" />
</rule>
</rules>
</rewrite>购物车/标签-软件-P590.aspx>产品/标签-软件/niceware/
<rewrite>
<rules>
<rule name="inde2x" stopProcessing="true">
<match url="cart/Label-Software-P590.aspx" />
<action type="Redirect" url="http://yourdomian/products/label-software/niceware/" />
</rule>
</rules>
</rewrite>https://stackoverflow.com/questions/59666677
复制相似问题