- differences between jet and odbc
- sugarcrm not inserting email
- select random records from access
- button click event firing twice
- how to send an email using cdosys
- installing perl on win2003 64 bit
- asp.net page event order
- rewrite rule for subdomains only
- extra items in javascript array
- IE7 margin auto not working
- IE7 border style dotted glitch
- ByRef and ByVal in vbscript
- weather rss feed
- Classic asp crib sheet
- Firefox onsubmit image change
- limit records in access
- AccessDataSource is thick
- double margins in IE6
- extra image padding in html emails
- decimal places in linux flash player
- broken emails in outlook 2007
- double spaced IE list items
- cannot remove movieclip
articles:
rewrite rule for subdomains only
I recently encountered a situation where I wanted a rewrite rule for isapi rewrite that would rewrite all subdomain urls, but leave the main www domain alone.
So for example:
test.domain.com
would be rewritten to
domain.com/?param=test
something.domain.com
would be rewritten to
domain.com/?param=something
But www.domain.com won't be rewritten at all.
After many desk-head based collisions I finally got it working: here's the rewrite rule you need to match subdomains as the hosts you are interested in, and not www:
RewriteCond Host: ^((?:(?!www).)*)\.domain\.com
Here's the explanation of how it works:
| ^ | # Start at the beginning of the string |
| ( | # Capture |
| (?: | # Complex expression: |
| (?!www) | # make sure we're not at the beginning of www |
| . | # accept any character |
| )* | # any number of times |
| ) | # End capture |
| \.domain\.com | # and ending at .domain.com |