URLRewriter.NET Regex


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



Copy this code and paste it in your HTML
  1. <rewriter>
  2.  
  3. <!-- EXCEPT FOR PREDEFINED DIRECTORIES -->
  4.  
  5. <rewrite url="~/(.+)/((js|img|css|op|mtn)/(.+))" to="~/$2" processing="stop"></rewrite>
  6.  
  7. <!-- EXCEPT FOR COMMONLY IMPORTED FILES -->
  8.  
  9. <rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.swf|\.zip|\.js)(\?.+)?)$" to="$1" processing="stop" />
  10.  
  11. <!-- ALL URL WILL BE REWRITTEN -->
  12.  
  13. <rewrite url="~/(.+)/(.+).aspx(\?(.+))?$" to="~/$2.aspx?site=$1&amp;$4" processing="stop"></rewrite>
  14.  
  15. </rewriter>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.