• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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]

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.