Associate
- Joined
- 29 May 2003
- Posts
- 2,038
- Location
- Cambridge
For a site we manage and for which we have the .com and .co.uk variant of the domain name, I've been asked to ensure that the site pages are viewable whether the user types the www bit in the location bar of their browser.
Say the actual site files were hosted under:
We'd want
to show the same files and change the URL in the location bar to http://www.site.com
If needs be the 'with the www' option can be handled easily via Plesk running on the hosting server - just a matter of setting up standard rather than frame forwarding. Can't see any way for it to handle 'without the www' though.
To cope with the 'no www' option, I suspect this will need to be done with an .htaccess file, but I confess I'm a bit of a novice with these - I've only ever used them thus far for preventing the listing of a directory. I've just been poking around on Google for the last hour or so and found lots of examples, but nearly all are talking about forwarding specific directories and such like, rather than an entire domain with or without a www prefix like I'm needing to do here.
Any suggestions as to how I can go about this? I don't doubt for a second what I'm needing to do is utterly simple, but I'm wary of stumbling in with only half a grasp of what I'm doing and fouling things right up!
Say the actual site files were hosted under:
Code:
http://www.site.com
We'd want
Code:
http://site.com
OR
http://www.site.co.uk
OR
http://site.co.uk
to show the same files and change the URL in the location bar to http://www.site.com
If needs be the 'with the www' option can be handled easily via Plesk running on the hosting server - just a matter of setting up standard rather than frame forwarding. Can't see any way for it to handle 'without the www' though.
To cope with the 'no www' option, I suspect this will need to be done with an .htaccess file, but I confess I'm a bit of a novice with these - I've only ever used them thus far for preventing the listing of a directory. I've just been poking around on Google for the last hour or so and found lots of examples, but nearly all are talking about forwarding specific directories and such like, rather than an entire domain with or without a www prefix like I'm needing to do here.
Any suggestions as to how I can go about this? I don't doubt for a second what I'm needing to do is utterly simple, but I'm wary of stumbling in with only half a grasp of what I'm doing and fouling things right up!