I setup a website and transformed that old site's title. So temporarily 2 sites are running.

  • world wide web.mydomain.com (new site)
  • legacy.mydomain.com (old site)

However , still some traffic involves the brand new site incorrectly and I'm not going my rails application to deal with that (rails is kinda slow and takes lotta assets). Rather, I would like apache to redirect it towards the old one before it reaches towards the rails application.

The incorrect traffic url is definitely like "www.mydomain.com/bbs/...". So I wish to remove demands with '/bbs/' and redirect it to "legacy.mydomain.com/bbs/...". I believe I'm able to do this on my small .htaccess file. But I'm not sure crafting the rule. mod_rewrite is a component of my server.

Are you able to help? Thanks.

Mike

Try:

RewriteCond %{HTTP_HOST} ^(www\.)?mydomain\.com$   [NC]
RewriteRule ^bbs/ http://legacy.mydomain.com%{REQUEST_URI}  [R=301,L]