Default WordPress web.config file, with permalinks


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

For use with a WordPress install, on a Windows server.


Copy this code and paste it in your HTML
  1. <configuration>
  2. <system.webServer>
  3. <rewrite>
  4. <rules>
  5. <rule name="CanonicalHostNameRule2" stopProcessing="true">
  6. <match url="(.*)" />
  7. <conditions>
  8. <add input="{HTTP_HOST}" pattern="^domain\.com$" />
  9. </conditions>
  10. <action type="Redirect" url="http://www.domain.com/{R:1}" />
  11. </rule>
  12. <rule name="CanonicalHostNameRule1" stopProcessing="true">
  13. <match url="^(\w*/)?index\.php" />
  14. <conditions>
  15. <add input="{HTTP_HOST}" pattern="domain\.com$" />
  16. </conditions>
  17. <action type="Redirect" url="http://www.domain.com/{R:1}" />
  18. </rule>
  19. <rule name="wordpress" patternSyntax="Wildcard">
  20. <match url="*" />
  21. <conditions>
  22. <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
  23. <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
  24. </conditions>
  25. <action type="Rewrite" url="index.php" />
  26. </rule>
  27. </rules>
  28. </rewrite>
  29. </system.webServer>
  30. </configuration>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.