Posted By

batfan on 02/04/11


Tagged

webconfig


Versions (?)

web.config Default


 / Published in: ASP
 

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <configuration>
  3. <system.webServer>
  4. <modules runAllManagedModulesForAllRequests="true" />
  5. <rewrite>
  6. <rules>
  7. <rule name="CanonicalHostNameRule1" stopProcessing="true">
  8. <match url="^(\w*/)?default\.aspx" />
  9. <conditions>
  10. <add input="{HTTP_HOST}" pattern="domain\.com$" />
  11. </conditions>
  12. <action type="Redirect" url="http://www.domain.com/{R:1}" />
  13. </rule>
  14. <rule name="CanonicalHostNameRule2" stopProcessing="true">
  15. <match url="(.*)" />
  16. <conditions>
  17. <add input="{HTTP_HOST}" pattern="^domain\.com$" />
  18. </conditions>
  19. <action type="Redirect" url="http://www.domain.com/{R:1}" />
  20. </rule>
  21. </rules>
  22. </rewrite>
  23. </system.webServer>
  24. </configuration>

Report this snippet  

You need to login to post a comment.