The GENERAL consensus in most web/DNS hosting service providers is to have your actual site at
www.damain.com, and any attempt to visit
damain.com/somepath/somefile gets auto-redirected (via HTACCESS or whatever it's called, or similar for non-Apache) to
www.damain.com/somepath/somefile.
That way, at the very least, you have only one possible collection of page serves to log or process... But also it reduces the headaches of making sure "both" subdomains work.
I believe there's a good explanation on the
www.NearlyFreeSpeech.net website...
- - -
update: it's actually "htdocs", and here's the info right from their "members" FAQ pages...
1.
https://members.nearlyfreespeech.net/support/faq?q=BareDomain#BareDomain?? I have NearlyFreeSpeech.NET DNS and
www.mydomain.com works but mydomain.com does not. Why?
By default, this is the correct behavior. Using URLs of the form
http://mydomain.com/ creates a number of problems, and we strongly recommend that you avoid it. Some of the limitations are:
* It creates noncanonical URLs for your site. It is highly desirable to have one URL for each page, for purposes of bookmarking, etc. Having multiple valid URLs for the same page makes your site look less popular, both in rankings and search engines.
* It is less reliable. DNS CNAME records cannot be used in this situation. You can put in a couple of A records, but this is still not as effective for load balancing and fault tolerance as doing it the "right" way.
* It becomes hopelessly confusing if you have (or might ever have) more than one site under the domain. (Which site does mydomain.com refer to?)
* One name should do one thing. Bare domain names already serve the purpose of organizing the domain, and often they do email duty as well. Web traffic is better kept in its own box.
Although we disagree with this practice, you are still welcome to use it with our service. Just add the bare domain name as an alias to your site and, if you have NearlyFreeSpeech.NET DNS, our system will set it up automatically.
We strongly encourage you to consider the alternatives and implications before enabling this feature. The best compromise solution we have found is to
create a separate site for the bare domain name that redirects a visitor to the real site. Visit
http://nearlyfreespeech.net/ and watch what happens in your browser's address bar for an example of how this works.
2.
https://members.nearlyfreespeech.net/support/faq?q=ForwardSite#ForwardSite?? How do I create a website for the sole purpose of forwarding visitors to another website?
You can do this by creating a one-line .htaccess file in the htdocs directory of the forwarding site. This line should look like:
RedirectPermanent /
http://www.example.com/Replace
www.example.com with the name of the site that you wish to forward users to. This is good because it works for all sorts of URLs, not just the main site. For example, if you use this technique to forward example.com visitors to
www.example.com and someone visits
http://example.com/subdir/page.html they will be forwarded to
http://www.example.com/subdir/page.html, whereas most other forwarding techniques would result in an error.
To set this up to forward
http://example.com/ to
http://www.example.com/:
1. Make sure the regular name,
www.example.com, works first.
2. Create the forwarding web site. If your site is called example, you may want to call it something like examplefw.
3. Create the .htaccess file in the examplefw website with the contents described above:
RedirectPermanent /
http://www.example.com/ 4. Add example.com as an alias to the examplefw site on the Site Information page.
- - -
^ so even if you don't/can't do the above, you at least get the "idea" of why/what needs to be done.
