detox1978
asked on
IIS Web.config: redirect non-www to www
Hi All,
Could someone help me with the web.config code i need to ensure all websites are prefixed with www.
Many thanks
D
Could someone help me with the web.config code i need to ensure all websites are prefixed with www.
Many thanks
D
ASKER
thanks. I have multiple websites. is there a catch all?
What do you mean multiple websites ?
Are they on same domain ?
Redirection is working from non www domain and forwarding request to www.doman.com
If you have few websites with different name like
www.domain.com
www1.domain.com
www2.domain.com
then you need to create more rules but if user will put http://domain.com in browser then only first rule will work.
Are they on same domain ?
Redirection is working from non www domain and forwarding request to www.doman.com
If you have few websites with different name like
www.domain.com
www1.domain.com
www2.domain.com
then you need to create more rules but if user will put http://domain.com in browser then only first rule will work.
you could use the redirection function in IIS. See the link below
https://technet.microsoft.com/en-us/library/cc770409(v=ws.10).aspx
https://technet.microsoft.com/en-us/library/cc770409(v=ws.10).aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Make sure your.domain.name below is changed to your domain name.
NOTE: If you already have a web.config with rules configured, add the rule below, otherwise a full web.config example is below it.