Posted By

omixen on 04/16/08


Tagged

url Net rewriting webconfig urlrewriternet


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

omixen
Tyster


URLRewriter.NET Regex


 / Published in: XML
 

  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  

You need to login to post a comment.