Link to home
Start Free TrialLog in
Avatar of dgrafx
dgrafxFlag for United States of America

asked on

web.config file

I need a rewrite rule and can't get the syntax to remove the www OR ANY subdomain from domain.com
so www.domain.com or ww3.domain.com or xyz.domain.com will all rewrite to domain.com

thanks
Avatar of Aaron Tomosky
Aaron Tomosky
Flag of United States of America image

Use the negate="true" flag to redirect anything not domain.com to domain.com like in the canonical host name example here
http://ruslany.net/2009/04/10-url-rewriting-tips-and-tricks/
Avatar of dgrafx

ASKER

I see that I rewrote my question and left out a crucial bit

Is there a way to use this to rewrite multiple domains in one rule?
i.e. "domain1.com|domain2.com|domain3.net"
and the action is to rewrite back to origin domain?
www.domain.com would be domain.com & www.domain3.net would be domain3.net

Thanks ...
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
That should work. You could also use something like ^ww?\.(*.)
Many different ways to do regex
Avatar of dgrafx

ASKER

see my last post