• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

(help) htaccess WWW

Status
Not open for further replies.
Joined
Sep 28, 2006
Posts
402
Reaction score
6
Does anyone have a snippet or could help change my standard .htaccess to something dynamic?

Within all my sites I force WWW with the following code.
Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

For each site the htaccess file needs to be manualy edited to the domain name. How could I make this dynamic?
 
My god is that it!
Looks about right, i'll give it a spin

Thanks for a quick reply.
 
Status
Not open for further replies.
Top Bottom