hello..

i have to write htaccess for mysite. actually we have two domains. '.com and .in' . for example i opened '.com' site it will actomatically access files from '.in' domain. there is no files in .com site. how to write .htaccess for this.

thanks.

Redirecting everything from .com to .in

RewriteCond %{http_host} domain.com [nc,or]
RewriteCond %{http_host} www.domain.com [nc]
RewriteRule ^(.*)$ http://www.domain.in/$1 [r=301,nc]

Redirecting everything from .com to .in

RewriteCond %{http_host} domain.com [nc,or]
RewriteCond %{http_host} www.domain.com [nc]
RewriteRule ^(.*)$ http://www.domain.in/$1 [r=301,nc]

i have a small doubt. for example i am opening www.test.com/usa. automatically it access files from www.test.in/usa. but i have to display url same www.test.com/usa. only iam accessing files from '.in'. display url will same

I think you need to remove the R flag.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.