Handling both www.domain.com and domain.com access

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
7/11/2013 8:50:38 AM
Gravatar
Total Posts 4

Handling both www.domain.com and domain.com access

I started off with a single site installation on Windows Azure hosting, but eventually added a couple of additional domains pointed to the same IP address. To begin with all the domains simply accessed the main site, which correctly redirected to the hostname I specified when I created the original single site (domain1.com). However it was recently brought to my attention that www.domain1.com was not working to access the site. Since I had only the single site installed, I was not getting the Host Name Mapping tab on the site settings page. Adding an entry to the SiteHosts table manually for www.domain1.com had no effect. Thinking that the SiteHosts table might not be used unless multiple sites were actually configured, I went ahead and created a 2nd site for one of the new domains I recently acquired, but even after adding the host name mapping for www.domain1.com, the 1st site is only accessable as domain1.com and not as www.domain1.com.

How do I fix things so that www.domain1.com will work correctly ??

Also -- adding a host name mapping does not check for duplicate host names.. I was able to add www.domain1.com to the list multiple times... this happened because the list does not update when you hit the add button.. a problem that is already a reported bug.

7/11/2013 10:09:49 AM
Gravatar
Total Posts 18439

Re: Handling both www.domain.com and domain.com access

When there is only one site then no host name mapping is needed all hosts names that come to the installation use the same single site. The only purpose of the host name mapping is for resolving the site id so if there is only 1 site there is no need to resolve anything.

In a multi site installation, the new site must first be saved before the host name can be added because the site id must be established, so the tab for host names is not shown in the ui until after the new site is first saved.

When you add a host name it is done inside an updatepanel which may in some cases be slow to update in the ui. I will look into preventing duplicates but you should be careful about it in the meantime to avoid any duplication, ultimately it will resolve to the first site id it finds attached to the host name.

For SEO you really do not want your site to use both the domain with and without www (nor do you want multiple domains with the same content), so you should pick one and force it as the preferred one.

7/11/2013 12:31:08 PM
Gravatar
Total Posts 4

Re: Handling both www.domain.com and domain.com access

yes I noticed the prefered host name and had that option set in the config but still www.domain1.com doesnt redirect to domain1.com so when people out of habit add the www, they get a not found.... and if I set the prefered host name to www.domain1.com I get not found for everything not mapped to the second site.

 

7/11/2013 12:49:36 PM
Gravatar
Total Posts 18439

Re: Handling both www.domain.com and domain.com access

I'm not clear from your question exactly what things you have configured

you should have host name mappings for www.domain.com and domain.com if you want the site to respond to both.

Then if you want the preferred to be without www then put domain.com for the preferred hostname

I have just the opposite on this site www.mojoportal.com is preferred so for example the url (whether entered manually or clicked) http://mojoportal.com/community will redirect to http://www.mojoportal.com/community it will not result in page not found

it should work no differently going the other way with and without www is just 2 host names

if one of yours is not working first make sure it is resolving to the correct ip address when you ping the host name and if it is a shared ip address with other sites then there must also be in IIS host name headers to make it resolve to the correct IIS site. I'm not sure how that plays out in Azure but if you get an IIS 404 page then it is not even reaching mojoPortal code

You must sign in to post in the forums. This thread is closed to new posts.