I can get site.com to change to www.site.com using .htaccess I can't seem to get it to work with any folders here's what I have.... RewriteEngine on RewriteCond %{HTTP_HOST} ^site\.com$ [NC] RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,L] but if you type in site.com/blog it still goes to the NON-www version of the blog help appreciated James.
Try this code: Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^site\.com [nc] RewriteRule ^(.*)$ http://www.site.com/$1 [r=301,nc] Code (markup):
that works with site.com/forum >> www.site.com/forum but doesn't work with site.com/blog >> www.site.com/blog could wordpress' own .htaccess be interfering?
update:: I can do mysite.com to www.mysite.com I can do mysite.com/forum to www.mysite.com/forum But It will not let me do mysite.com/blog to www.mysite.com/blog not sure if the htaccess in the wordpress folder is causing the problem, but the blog doesn't work at all if I delete it. This is what I have in the root htaccess: Options +FollowSymlinks RewriteEngine on RewriteCond %{http_host} ^mysite\.com [nc] RewriteRule ^(.*)$ http://www.mysite.com/$1 [r=301,nc] Code (markup): the one in the blog folder is the standard one: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /myblog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /myblog/index.php [L] </IfModule> # END WordPress Code (markup):
How is your WP blog setup? Is it supposed to be in the main page, or a directory below the main site? If the blog is in a directory such as http://mysite.com/blog just put the WP rewrite lines in a .htaccess file where your blog is located. Just put the code that I posted before, in the .htaccess file in the public_html/ folder and it will work for every single folder you have on your site. All of them will be redirected to have the www. at the start of every domain. If you would like, give me temp FTP details of your site so that You can show me where you are putting the code. And I can fix it for you.
It's in a directory one level below main. I have tried putting the wordpress .htaccess in the root and in the actual folder it came with. The same with the 301 htaccess. Odd that it would make the forum redirect but not the blog Very kind, I will take you up on that as soon as I get the site open. Thanks. James.