.htaccess - add www to htaccess for contextdependant urls -


i know his

rewriteengine on rewritecond %{http_host} ^yourdomain\.net$ rewriterule (.*) http://www.yourdomain.net/$1 [r=301,l] 

however, not know beforehand domainname (it can 1 of 30). possible make yourdomain.com variable matches 30 possible domains?

you don't need match 30 domains:

rewriteengine on rewritecond %{http_host} !^www\. [nc] rewriterule (.*) http://www.%{http_host}/$1 [r=301,l] 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

javascript - Preserving URL fragment through CAS sign-on -

asp.net mvc - Implementing normal user/pass, Twitter & Facebook auth -