I have a forum and when browsing even though starting at 'www.' it will sometimes click to '.domain.com'. It interfers with the cookies and forces my users to log out. I want to make all URLs forced to have the 'www.'. I have tried using the .htacess file but doesn't seem to work. anyone know why? #RewriteCond %{HTTP_HOST} !^www\.xxxxxx\.com #RewriteRule (.*) http://www.xxxxxx.com/$1 [L,R=301] RewriteRule ^((urllist|sitemap_).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L] RewriteCond %{REQUEST_URI} !(admincp/|modcp/|cron|vbseo_sitemap) RewriteRule ^((archive/)?(.*\.php(/.*)?))$ vbseo.php [L,QSA] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !/(admincp|modcp|clientscript|cpstyles|images)/ RewriteRule ^(.+)$ vbseo.php [L,QSA] PHP:
it's done via the .htaccess file.. RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] Code (markup): Change "example.com" to match your domain... while this is for the base domain it should implement into all site links. EDIT: your .htaccess file posted in your opening post has the # symbol in front of the first two lines, this is commenting out the lines which is blocking the redirect, try removing the "#" symbol from the first two lines.. if that doesn't work try adding my code above near the top of your .htaccess file. Also make sure you do not have "RewriteEngine On" in there twice. Regards, Darren
wow i swear, i'm an idiot sometimes. you look so hard but don't look for the simple things. the # signs was what was wrong. i can't believe i didn't notice it. thank you so much for pointing that out.
do worries mate Happens to the best of us.. done that many times before i usually spend hours on something silly like that and take a look at it the next morning and bang it stands out.
Of note, using www is rather antiquated and is of no value in most cases. What those exceptions are, I can't even recall.