0
我有一箇舊網站需要重定向到一個新的網站,相同的域名,相同的ID,但不同的文件夾約12000個URL。 我創建了一個靜態rewriteMaps.config文件,這是我的老樣本和新的URLweb.config舊網址到新的url重定向
<rewriteMaps>
<rewriteMap name="Redirects">
<add key="/4935/apple-iphone-event-what-to-expect" value="/Node/d/4946" />
<add key="/4936/twitter-tablet-android-app-details-leaked" value="/Node/d/4947" />
<add key="/4937/samsung-ativ-q-not-launching-this-year" value="/Node/d/4948" />
<add key="/4938/amazon-smartphone-3d-screen" value="/Node/d/4949" />
<add key="/4939/Newkia-a-Nokia-on-Android" value="/Node/d/4950" />
<add key="/4940/Nexus-5-first-proper-leaks-based-render-looks-exciting" value="/Node/d/4951" />
<add key="/4941/survey-iphone-5s-5c-upgrade" value="/Node/d/4952" />
<add key="/4942/ipad-ipad-mini-leak-alleged-tablet-shell" value="/Node/d/4953" />
<add key="/4943/redesigned-google-logo-found-in-chrome-for-android-beta" value="/Node/d/4954" />
<add key="/4944/Amazon-says-no-smartphone-this-year-no-free-phone-ever" value="/Node/d/4955" />
</rewriteMap>
</rewriteMaps>
我的web.config文件
<rewrite>
<rewriteMaps configSource="rewriteMaps.config" />
<rules>
<rule name="Redirect old website urls">
<match url=".*" />
<conditions>
<add input="{Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="{C:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
文件的大小成爲2 MB擁有超過12000網址,我問是否有重定向條件匹配這種情況!
沒有,它開始從1到12026 –
我已經編輯我的回答 –