Untuk server hosting linux code yg ditambahkan adalah :
#Turns the rewrite engine on.RewriteEngine on #Fix missing trailing slash character on folders. RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L] #www.domain.com and domain.com will map to the folder {root}/folder1/ RewriteCond %{HTTP:Host} ^(?:www\.)?domain\.com$ RewriteCond %{REQUEST_URI} !^/folder1/ RewriteRule ^(.*) folder1/$1 [NC,L,NS] #www.otherdomain.com and otherdomain.com will map to the folder {root}/folder2/ RewriteCond %{HTTP:Host} ^(?:www\.)?otherdomain\.com$ RewriteCond %{REQUEST_URI} !^/folder2/ RewriteRule ^(.*) folder2/$1 [NC,L,NS] #subdomain.domain.com will map to the folder {root}/folder3/ RewriteCond %{HTTP:Host} ^(?:subdomain\.domain\.com)?$ RewriteCond %{REQUEST_URI} !^/folder3/ RewriteRule ^(.*) folder3/$1 [NC,L,NS] |
dan untuk server hosting Windows code nya adalah :
#Turns the rewrite engine on.RewriteEngine on #Fix missing trailing slash character on folders. RewriteRule ^([^.?]+[^.?/])$ $1/ [R,L] #www.domain.com and domain.com will map to the folder {root}/folder1/ RewriteCond %{HTTP:Host} ^(?:www\.)?domain\.com$ RewriteRule (.*) /folder1/$1 [NC,L,NS] #www.otherdomain.com and otherdomain.com will map to the folder {root}/folder2/ RewriteCond %{HTTP:Host} ^(?:www\.)?otherdomain\.com$ RewriteRule (.*) /folder2/$1 [NC,L,NS] #subdomain.domain.com will map to the folder {root}/folder3/ RewriteCond %{HTTP:Host} ^(?:subdomain\.domain\.com)?$ RewriteRule (.*) /folder3/$1 [NC,L,NS] |
sumber :
http://www.brinkster.com/kb/Article-125-How-do-I-redirect-a-domain-or-subdomain%3f
0 comments:
Post a Comment