Hi, I want to redirect my http:// yourname.com to http:// www . yourname.com but when I place a permanent redirect (301) to the www the index page doesn’t work anymore. Does anybody know how to redirect from the http:// to the www. I only have this problem when I redirect to the same domain name Thanks
Try This. <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST}!^www\.example\.com RewriteRule (.*) http://www.example.com/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(([^/]+/)*)index\.html\ HTTP/ RewriteRule index\.html$ http://www.example.com/%1 [R=301,L] </IfModule> Code (markup): I wish it will help you to redirect all your www and no www traffice whether it is from visitors or search engine bot to www version of the site.