| 0 comments ]

How to add or remove WWW on URLs using htaccess. Adding www to your site url using .htaccess

RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite.in$ 
RewriteRule (.*) http\:\/\/www\.yoursite\.in\/$1 [R=301]

Removing www from your site url using .htaccess

RewriteCond %{HTTP_HOST} ^yoursite\.in$ [OR]
RewriteCond %{HTTP_HOST} ^www\.yoursite\.in$ [NC]
RewriteRule ^/?$ "http\:\/\/yoursite\.in\/" [R=301,L]

0 comments

Post a Comment

Please put your comments here. your questions, your suggestions, also what went wrong with me.