Welcome Guest, Not a member yet? Register   Sign In
HTACCESS: Force www

I have this, which is working alright. But I'm wondering if the domain itself can be made dynamic (so without explicitly entering the domain).

RewriteCond %{HTTP_HOST} ^domain.nl [NC]
RewriteRule ^(.*)$ http://www.domain.nl/$1 [L,R=301]

I'm looking for the same thing.
The goal is to have a htaccess file that works on local and on production without any update.

Please see my first post in [url="http://ellislab.com/forums/viewthread/105759/"]this thread[/url].

It works, thanks TheFuzzy0ne! Smile

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

Theme © iAndrew 2016 - Forum software by © MyBB