Hi; I need help about my .htaccess. Some sites are giving me link with sitename.com/section/category/ link. If want to create a permanent redirect from sitename.com/section/category/ to www.sitename.com/section/category/ with my .htacess. If somebody gives me link without www, I want to add www to my urls. Thanks for your comments.
if you use the following lines in your .htaccess file RewriteEngine On rewritecond %{http_host} ^sitename\.com [nc] rewriterule ^(.*)$ http://www.sitename\.com /$1 [r=301,nc] Code (markup): then "www." will be prefixed onto all URLS that do not already have the 'www' in front of sitename.com
By the way, another handy rewrite rule that makes sure that google and the other search engines think that www. sitename.com/index.php and www. sitename.com/ are one and the same URL (as opposed to 2 different urls that have PR split betwen them), then add the following to the .htaccess file in your root directory RewriteCond %{THE_REQUEST} /index\.php [NC] RewriteRule ^index\.php$ /$1 [R=301,L] Code (markup):