Russkie Established Member ☆ 10 ☆ Impact 101 Oct 29, 2012 1K views 1 reply #1 Guys, does anyone know how to re-direct domain name to its sub-domain? I mean, http://sample.tld/ and http://www.sample.tld/ must forward users to http://subdomain.sample.tld/ Any clue?
Guys, does anyone know how to re-direct domain name to its sub-domain? I mean, http://sample.tld/ and http://www.sample.tld/ must forward users to http://subdomain.sample.tld/ Any clue?
C Chicken Full Stack DeveloperVIP Member VIP ★ 20 ★ Impact 73 Oct 29, 2012 1 point #2 You should google the problem before posting Someones asked this before on another forum, http://www.webhostingtalk.com/showpost.php?p=3449952&postcount=4 Create a file called .htaccess and put in the following. Change domain to your actual domain and sub to your actual sub. Code: RewriteEngine On Options +FollowSymlinks RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^ http://sub.domain.com [R,L]
You should google the problem before posting Someones asked this before on another forum, http://www.webhostingtalk.com/showpost.php?p=3449952&postcount=4 Create a file called .htaccess and put in the following. Change domain to your actual domain and sub to your actual sub. Code: RewriteEngine On Options +FollowSymlinks RewriteCond %{HTTP_HOST} ^(www\.)?domain\.com$ [NC] RewriteRule ^ http://sub.domain.com [R,L]