...

View Full Version : Adding www for all but 1 sub-domain name



djm0219
11-01-2010, 08:02 PM
This should be simple but I'm not having any luck getting the rules correct. I started off with the following to always have the www added to the domain if it wasn't already there and it works just like it should.



Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.dynacompsolutions\.com$ [NC]
RewriteRule ^(.*)$ http://www.dynacompsolutions.com/$1 [R=301,L]


I have a sub-domain named forums.dynacompsolutions.com that I do NOT want the www added to. With the rules above it is getting written as http://www.dynacompsolutions.com/Forums and although that works it is not how I want the URL to be bookmarked/used.

I tried adding
RewriteRule ^{HTTP_HOST}/Forums "http://Forums.dynacompsolutions.com/$1 [L] before the RewriteCond shown above and although it didn't generate any complaints it also does not do any rewriting.

The complete set of rules I currently haven't which aren't doing what I'd like them to do is:



Options +FollowSymLinks
RewriteEngine On

RewriteRule ^{HTTP_HOST}/Forums/ "http://forums.dynacompsolutions.com/index.php [L]
RewriteCond %{HTTP_HOST} !^www\.dynacompsolutions\.com$ [NC]
RewriteRule ^(.*)$ http://www.dynacompsolutions.com/$1 [R=301,L]

A pointer or suggestion on where I'm going wrong with this would be much appreciated. I keep trying things but most of them cause Apache to complain severely and I keep taking the site down as a result.

djm0219
11-03-2010, 10:58 PM
Gentle nudge ... any suggestions, wild or otherwise, would be greatly appreciated.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum