If you have root (and ssh) access to your webhost, you should add a symbolic link to your www folder, in the htdocs directory. All directories in your htdocs folder are considered subdomains by your webserver. So if your DNS record points you to your server for the wildcard subdomain, your webserver will handle further processing of subdomains. So this symbolic link will make your server to load the same content for www.mysite.com and mysite.com.
cd /patch/to/htdocs
ln -s www mysite
Replace mysite by your domain name, but without the country suffix and www prefix. It should give you something like this:
[vhostxxxx@ssh:~/domains/mysite.com/htdocs]$ ls -l
total 3
lrwxrwxrwx 1 vhostxxxx vhostuser 3 2012-11-10 12:47 mysite -> www
drwxr-xr-x+ 9 vhostxxxx vhostuser 20 2012-11-13 21:52 www`
Now, if I would browse to mysite.com, I would see the same site as www.mysite.com.
As for linking in your navigation:
`<div id="page">
<a class="topNavigationLink" href="http://mysite.com/">Home</a>
<a class="topNavigationLink" href="http://wwww.mysite.com">Home</a>
<a class="topNavigationLink" href="wwww.mysite.com">Home</a>
<a class="topNavigationLink" href="page1.html">page1</a>
<a class="topNavigationLink" href="/page2.html">page2</a>
</div>`
This will link as follows (in some order):
- To the directory (or symbolic link) called
mysite
in your htdocs
- To the directory (or symbolic link) called
wwww
in your htdocs
- This is wrong. It will point at a page called
wwww.mysite.com
, which then should be located in the same directory as the page you linked it from. So if you linked it from htdocs/www/index.html
it will point to htdocs/www/wwww.mysite.com
. Always use http://
if your address includes a domain.
- To the page called
page1.html
, located in the same directory as the page you linked it from. If you linked it from htdocs/www/SomeTopic/page99.html
it will point to htdocs/www/SomeTopic/page1.html
- To the page called
page2.html
, located in the document root. If you linked it from htdocs/www/SomeTopic/page99.html
it will point to htdocs/www/page1.html