• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HTACCESS: Force www

#1
[eluser]codex[/eluser]
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).

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

#2
[eluser]Kopel[/eluser]
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.

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

#4
[eluser]Kopel[/eluser]
It works, thanks TheFuzzy0ne! Smile

Code:
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.