hi, im running virtualmin under Debian etch which has been great its just now cant figure out why the servers ive created are just listing as http://domain.com rather than with the www.
is there an option somewhere or some way to tell it to make www the default ??
When you say that they’re “listing as domain.com”, where is that listing you’re looking at?
Virtualmin sets up the domain name "domain.com" whenever it creates the Virtual Server, but it also (by default, anyhow) sets up "www.domain.com" as an alias.
Both would be valid ways of accessing the site.
Where is it that isn’t working as you’d hope?
-Eric
bear in mind there is temporary htaccess rewite till i can fix it so going to www. at the moment writes out the www, but this is temp and just for continuity.
Heh, well that does explain a few things
Okay, the links being written are done so by the PHP generating the page there.
I’m not sure if your site is using a CMS of some sort, or if that’s custom PHP.
If it’s a CMS, you may need to update the URL it thinks it’s running on to include the ‘www’. That would be in the Settings/Preferences somewhere (though where exactly depends on what CMS it is).
If that’s a custom app you created, then there’s likely PHP code or a template somewhere containing that URL rather than the ‘www’ you’re interested in.
-Eric
You can add a redirect by adding the following code to either a .htaccess file in the public_html folder for the above domain, or in the Apache’s VirtualHost section for the domain:
bear in mind there is temporary htaccess rewite till i can fix it so going to www. at the moment writes out the www, but this is temp and just for continuity.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(thehelmetwarehouse.com.au)$
RewriteRule (.*) http://thehelmetwarehouse.com.au [R=301,L]
bear in mind there is temporary htaccess rewite till i can fix it so going to www. at the moment writes out the www, but this is temp and just for continuity.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(thehelmetwarehouse.com.au)$
RewriteRule (.*) http://thehelmetwarehouse.com.au [R=301,L]