Category Archives: htaccess

Redirect Subdomain of domain1 to subdomain of domain2

For example if we need to redirect x.domain1.com to x.domain2.com y.domain1.com to y.domain2.com and domain1.com to domain2.com Use #RewriteCond %{HTTP_HOST} ^(.*)domain1.com$ [NC] #RewriteRule ^(.*)$ http://%1domain2.com/$1 [R=301,L] but if we dont want to redirect domain1.com to domain2.com and only the subdomains then use Use the following code RewriteCond %{HTTP_HOST} ^(.*)\.sio-india\.org$ [NC] RewriteRule ^(.*)$  http://%1.sio-india.com/$1  [R=301,L]

Also posted in SEO, Subdomain | Tagged , , | Leave a comment

Auto Remove www from url using htacccess

To remove www from your url and make it SEO friendly  you need to add the following code to .htaccess file in your root. RewriteCond %{HTTP_HOST} ^www.sio-india.org$ [NC] RewriteRule ^(.*)$ http://sio-india.org/$1 [R=301,L]

Also posted in SEO | Leave a comment