Let's say a site should installed att domain.com/example but you you want the site to be located on another web host than the one domain.com uses (say due to lack of programming language support)?

Redirect? Iframing (vomit) ?

  • Does the web host you want to your site to be support addon domains? chchrist over 9 years ago
  • I don't know really. But if it's a special feature (beyond pretty basic package features) I don't think so. Jens Hedqvist over 9 years ago

2 answers

This was chosen as the best answer

iframe if it's a small amount of content that should appear seamlessly inside the existing site.

redirect with a 301 if it should make more sense to search engines and you don't mind showing the new url in the address bar.

.htaccess and mod_rewrite is one way: e.g.

RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\.bclm\.co\.uk [NC]
RewriteRule (.*) http://www.bclm.co.uk/$1 [R=301]
RewriteRule ^making_visit\.html$ http://www.bclm.co.uk/visit.htm [R=301]
RewriteRule ^making_visit1\.html$ http://www.bclm.co.uk/visit.htm [R=301]
Answered over 9 years ago by Tony Crockford

If you can change the DNS settings for the primary domain, an ideal solution might be to make the second web host a subdomain of the primary domain. Unlike folders, subdomains are made for this sort of thing :)

For example, one of my domains has a secondary content management system hosted on another server, so it is accessed via www2.example.com. Static resources are on yet a third domain: static.example.com.

In your case, I'd point foo.example.com to the second server. Then you can redirect from example.com/foo to foo.example.com:

RewriteCond ${HTTP_HOST} !^foo\.example\.com [NC]
RewriteRule ^foo(.*) http://foo.example.com/$1 [R=301]
Answered over 9 years ago by Justin Hileman