Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

My client asked me that a website that is hosted in one server (and pointing there through a domain) should also be accessed (into a specific directory) from another domain, which is not pointing there. For example:

http://www.foo.com, hosted at GoDaddy, with the full website

http://www.bar.com, hosted at Bluehost, needs to access http://www.foo.com/bar, as if it was the http://www.bar.com's root.

So, if anybody enters through http://www.bar.com, it should internally load http://www.foo.com/bar, without visually changing the url.

I amb not sure if this is possible using .htaccess or anything like this. Could anybody show me some light? Thanks in advance

share|improve this question
add comment

1 Answer

Something like this?

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !bar.com$ [NC]
RewriteRule ^(.*)$ http://www.foo.com/bar/$1 [L,R=301]

I found this in an article by searching for "rewrite all calls to other domain htacces".

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.