I have a site with a blog in a separate folder, so there is mysite.com and mysite.com/blog.
I'm trying to have all pages go to www. For my main site it works fine. But for my blog it does not. So:
mysite.com redirects properly to
www.mysite.com
mysite.com/blog/ stays at mysite.com/blog/ instead of
www.mysite.com/blog/
Here is the htaccess code for my main site
www.mysite.com:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [L]
</IfModule>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite\.com
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301,L]
Here is the htaccess in blog directory
www.mysite.com/blog/:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [L]
</IfModule>
Any suggestions?