Topic: 301 redirect for a subdomain (Read 776 times)
Hunky Junky Monky Man!
Posts: 60
408 credits Members referred : 0
« on: Aug 20, 2010, 03:04:00 pm »
Hi, I have site and i have subdomian in that site too.. i have 4 subdomains but the subdomains in the same one- www.(dot)subdomain(dot)domain(dot)com how to redirect in a proper way..please help me
Cyberpunk Wannabe
Posts: 34
208 credits Members referred : 0
« Reply #1 on: Aug 20, 2010, 05:08:58 pm »
To redirect a given domain/subdomain to another domain, add the following to your .htaccess file:
RewriteEngine On RewriteCond %{HTTP_HOST} ^subdomain.domain.com ReWriteRule ^/?(.*)$ http://targetdomain.com/$1 [L,QSA,R=301]
This will redirect subdomain.domain.com/some/path to targetdomain.com/some/path
Look up the docs for RewriteRule if you want to do anything more complicated. You can repeat the RewriteCond/RewriteRule pairing (with appropriate domain names) for each domain you want redirecting.
Just another rainy day
Posts: 1
6 credits Members referred : 0
« Reply #2 on: Aug 31, 2010, 05:11:48 am »
anthonyw give you a very good suggestions. I think this is the way you can redirect in a proper way.
Sandwich Artist
Posts: 24
158 credits Members referred : 0
« Reply #3 on: Sep 01, 2010, 01:06:28 pm »
use htaccess and write a redirect rule
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=10457