Implemented like so: Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} ^yoursite.com [NC] RewriteRule ^(.*)$ http://www.yoursite.com/$1 [L,R=301] Code (markup): it seems to work fine, i've heard that I need to change links to folders so that they include a trailing slash. My question is: is this true and if so, does it also apply to links which are htaccess created permalinks? (since its a fair amount of work which if possible i'd like to avoid)
heres a variation of the redirect the '!' means NOT - so the condition is true if the HTTP HOST is NOT like www.yoursite.com this is more flexible and will also redirect if you have other versions of your domain name on the server (your-site.com) or use other tlds (.de, .net etc) Options +FollowSymLinks RewriteEngine on rewriteCond %{HTTP_HOST} !^www.yoursite.com rewriteRule (.*) http://www.yoursite.com/$1 [R=301,L] Code (markup): you might need to escape the dots in the rewriteCond... rewriteCond %{HTTP_HOST} !^www\.yoursite\.com this doesnt need the [NC] because YourSite.coM also fulfills the condition and will redirect I think folders should be linked to with a trailing slash and if so I guess that applies to the permalinks since the browser / spider doesnt know whats gone on behind the web server a.