web.config Default


/ Published in: ASP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.